agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/launchers/AbstractJobLauncher.java
/**
     * Generates recursive listing of file items relative to the given baseFolder.
     * @param file the file to explore
     * @param baseFolder the root of the original listing
     * @param writer the {@link Writer} to where the file item should be written
     * @throws IOException if unable to write to the given writer
     */
Generates recursive listing of file items relative to the given baseFolder.
@param file the file to explore
@param baseFolder the root of the original listing
@param writer the  Writer to where the file item should be written
@throws IOException if unable to write to the given writer
Generates recursive listing of file items relative to the given baseFolder . @param file the file to explore @param baseFolder the root of the original listing @param writer the Writer to where the file item should be written @throws IOException if unable to write to the given writer
protected void printListing(File file, File baseFolder, Writer writer) throws IOException {
        if (file.isFile()) {
            String relativeFilePath = StringUtils.removeStart(file.getPath(), baseFolder.getPath());
            if (relativeFilePath.startsWith("/"))
                relativeFilePath = relativeFilePath.substring(1);
            writer.append(relativeFilePath).append("\n");
        } else {
            File[] fileListing = file.listFiles();
            if (fileListing != null) {
                for (File child : fileListing) {
                    String relativeChildPath = StringUtils.removeStart(child.getPath(), baseFolder.getPath());
                    if (relativeChildPath.startsWith("/"))
                        relativeChildPath = relativeChildPath.substring(1);
                    writer.append(relativeChildPath).append("\n");
                    if (child.isDirectory()) {
                        printListing(child, baseFolder, writer);
                    }
                }
            }
        }
    }
protected void printListing ( File file , File baseFolder , Writer writer ) throws IOException { if ( file . isFile ( ) ) { String relativeFilePath = StringUtils . removeStart ( file . getPath ( ) , baseFolder . getPath ( ) ) ; if ( relativeFilePath . startsWith ( "/" ) ) relativeFilePath = relativeFilePath . substring ( 1 ) ; writer . append ( relativeFilePath ) . append ( "\n" ) ; } else { File [ ] fileListing = file . listFiles ( ) ; if ( fileListing != null ) { for ( File child : fileListing ) { String relativeChildPath = StringUtils . removeStart ( child . getPath ( ) , baseFolder . getPath ( ) ) ; if ( relativeChildPath . startsWith ( "/" ) ) relativeChildPath = relativeChildPath . substring ( 1 ) ; writer . append ( relativeChildPath ) . append ( "\n" ) ; if ( child . isDirectory ( ) ) { printListing ( child , baseFolder , writer ) ; } } } } }
Generates recursive listing of file items relative to the given baseFolder.
Generates recursive listing of file items relative to the given baseFolder .