Search in sources :

Example 1 with FileHierarchyTracer

use of org.dbflute.helper.filesystem.FileHierarchyTracer in project dbflute-core by dbflute.

the class DfLastaDocTableLoader method preparePhysicalHolder.

protected DfLastaFlutePhysicalHolder preparePhysicalHolder(File rootDir) {
    final DfLastaFlutePhysicalHolder physicalHolder = new DfLastaFlutePhysicalHolder();
    final FileHierarchyTracer tracer = new FileHierarchyTracer();
    tracer.trace(rootDir, new FileHierarchyTracingHandler() {

        public boolean isTargetFileOrDir(File currentFile) {
            return true;
        }

        public void handleFile(File currentFile) throws IOException {
            final String path = toPath(currentFile);
            if (path.contains("/app/web/") && path.endsWith("Action.java")) {
                physicalHolder.addAction(currentFile);
            }
        }
    });
    return physicalHolder;
}
Also used : FileHierarchyTracer(org.dbflute.helper.filesystem.FileHierarchyTracer) FileHierarchyTracingHandler(org.dbflute.helper.filesystem.FileHierarchyTracingHandler) IOException(java.io.IOException) File(java.io.File)

Example 2 with FileHierarchyTracer

use of org.dbflute.helper.filesystem.FileHierarchyTracer in project dbflute-core by dbflute.

the class DfMailFluteTableLoader method collectFile.

// ===================================================================================
// Collect File
// ============
/**
 * @param fileList The list of saved list. (NotNull)
 * @param targetExt The extension of target path. (NullAllowed)
 * @param targetKeyword The keyword of target path. (NullAllowed)
 * @param exceptPathList The list of except path. (NotNull)
 * @param baseFile The base file. (NotNull)
 */
protected void collectFile(final List<File> fileList, final String targetExt, final String targetKeyword, final List<String> exceptPathList, final File baseFile) {
    final FileHierarchyTracer tracer = new FileHierarchyTracer();
    tracer.trace(baseFile, new FileHierarchyTracingHandler() {

        public boolean isTargetFileOrDir(File currentFile) {
            if (currentFile.isDirectory()) {
                return true;
            }
            return isCollectFile(targetExt, targetKeyword, exceptPathList, currentFile);
        }

        public void handleFile(File currentFile) {
            fileList.add(currentFile);
        }
    });
}
Also used : FileHierarchyTracer(org.dbflute.helper.filesystem.FileHierarchyTracer) FileHierarchyTracingHandler(org.dbflute.helper.filesystem.FileHierarchyTracingHandler) File(java.io.File)

Example 3 with FileHierarchyTracer

use of org.dbflute.helper.filesystem.FileHierarchyTracer in project dbflute-core by dbflute.

the class DfPmFileTableLoader method collectFile.

// ===================================================================================
// Collect File
// ============
/**
 * @param fileList The list of saved list. (NotNull)
 * @param targetExt The extension of target path. (NullAllowed)
 * @param targetKeyword The keyword of target path. (NullAllowed)
 * @param exceptPathList The list of except path. (NotNull)
 * @param baseFile The base file. (NotNull)
 */
protected void collectFile(final List<File> fileList, final String targetExt, final String targetKeyword, final List<String> exceptPathList, final File baseFile) {
    final FileHierarchyTracer tracer = new FileHierarchyTracer();
    tracer.trace(baseFile, new FileHierarchyTracingHandler() {

        public boolean isTargetFileOrDir(File currentFile) {
            if (currentFile.isDirectory()) {
                return true;
            }
            return isCollectFile(targetExt, targetKeyword, exceptPathList, currentFile);
        }

        public void handleFile(File currentFile) {
            fileList.add(currentFile);
        }
    });
}
Also used : FileHierarchyTracer(org.dbflute.helper.filesystem.FileHierarchyTracer) FileHierarchyTracingHandler(org.dbflute.helper.filesystem.FileHierarchyTracingHandler) File(java.io.File)

Example 4 with FileHierarchyTracer

use of org.dbflute.helper.filesystem.FileHierarchyTracer in project dbflute-core by dbflute.

the class DfFilePathTableLoader method collectFile.

// ===================================================================================
// Collect File
// ============
/**
 * @param fileList The list of saved list. (NotNull)
 * @param targetExts The extensions of target path. (NullAllowed)
 * @param targetKeyword The keyword of target path. (NullAllowed)
 * @param exceptPathList The list of except path. (NotNull)
 * @param baseFile The base file. (NotNull)
 */
protected void collectFile(List<File> fileList, String[] targetExts, String targetKeyword, List<String> exceptPathList, File baseFile) {
    final FileHierarchyTracer tracer = new FileHierarchyTracer();
    tracer.trace(baseFile, new FileHierarchyTracingHandler() {

        public boolean isTargetFileOrDir(File currentFile) {
            if (currentFile.isDirectory()) {
                return true;
            }
            return isCollectFile(targetExts, targetKeyword, exceptPathList, currentFile);
        }

        public void handleFile(File currentFile) {
            fileList.add(currentFile);
        }
    });
}
Also used : FileHierarchyTracer(org.dbflute.helper.filesystem.FileHierarchyTracer) FileHierarchyTracingHandler(org.dbflute.helper.filesystem.FileHierarchyTracingHandler) File(java.io.File)

Aggregations

File (java.io.File)4 FileHierarchyTracer (org.dbflute.helper.filesystem.FileHierarchyTracer)4 FileHierarchyTracingHandler (org.dbflute.helper.filesystem.FileHierarchyTracingHandler)4 IOException (java.io.IOException)1