Package org.apache.sis.internal.unopkg
Class JavaMaker.Copier
- All Implemented Interfaces:
FileVisitor<Path>
- Enclosing class:
- JavaMaker
Copies
*.class
files from source directory to output directory.
The output directory should already exist. It should be the case if all
sources files have been compiled before this method is invoked.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionpreVisitDirectory
(Path dir, BasicFileAttributes attrs) Determines whether the given directory should be visited.(package private) void
run()
Executes the copy operation.visitFile
(Path file, BasicFileAttributes attrs) Invoked for a file in a directory.Methods inherited from class java.nio.file.SimpleFileVisitor
postVisitDirectory, visitFileFailed
-
Field Details
-
source
The root of source and target directories. Files belowsource
will be copied with identical path (relative tosource
) undertarget
directory. -
target
The root of source and target directories. Files belowsource
will be copied with identical path (relative tosource
) undertarget
directory. -
count
int countNumber of files copied.
-
-
Constructor Details
-
Copier
Creates a new copier.- Parameters:
baseDirectory
- base directory of the module to compile.outputDirectory
- directory where the output Java files will be located.
-
-
Method Details
-
run
Executes the copy operation.- Throws:
IOException
-
preVisitDirectory
Determines whether the given directory should be visited. This method skips hidden directories.- Specified by:
preVisitDirectory
in interfaceFileVisitor<Path>
- Overrides:
preVisitDirectory
in classSimpleFileVisitor<Path>
-
visitFile
Invoked for a file in a directory. This method creates the directory if it does not exist and performs the actual copy operation.- Specified by:
visitFile
in interfaceFileVisitor<Path>
- Overrides:
visitFile
in classSimpleFileVisitor<Path>
- Throws:
IOException
-