OpenAPI 1.0

com.aquafold.openapi.filesystem
Interface AQFileSet


public interface AQFileSet

FileSet

A FileSet is a group of files. These files can be found in a directory tree starting in a base directory and are matched by patterns. Hence, any operations performed on the file set will be recursive by nature. The patterns are defined using the following methods setExcludes(String), setIncludes(String). Either base directory or file must be specified.

Synopsis:

fileset


Method Summary
 String getBaseDir()
          Retrieves the base directory for this fileset.
 int getSize()
          To get the number of files in the file set.
 void setBaseDir(String dirName)
          Sets the base directory for this fileset.
 void setExcludes(String excludes)
          Appends excludes to the current list of exclude patterns.
 void setFile(String fileName)
          Creates a single file fileset.
 void setIncludes(String includes)
          Appends includes to the current list of include patterns.
 

Method Detail

getBaseDir

String getBaseDir()
Retrieves the base directory for this fileset.

Returns:
The absolute path of the directory in the AQFileSet object.

setBaseDir

void setBaseDir(String dirName)
                throws Exception
Sets the base directory for this fileset. If setFile(String) was previously called, calling this method would throw an exception. Also, all operations on this file set will be recursive.

Parameters:
dirName - The base directory; required.
Throws:
Exception - If the directory name is not a valid string or if setFile(String) was previously called.

setFile

void setFile(String fileName)
             throws Exception
Creates a single file fileset. If setBaseDir(String) was previously called, calling this method would throw an exception.

Parameters:
fileName - The file name; required.
Throws:
Exception - If the file name is not a valid string or if setBaseDir(String) was previously called.

setExcludes

void setExcludes(String excludes)
Appends excludes to the current list of exclude patterns. Patterns may be separated by a comma or a space.

For Example:

To exclude all files, including ones found in any sub directories and subsequent sub directories in the base directory of this fileset.

 setExcludes("**/*");
 
To exclude all files, with a dll extension, including ones found in any sub directories and subsequent sub directories in the base directory of this fileset.
 setExclude("**/*.dll");
 

Parameters:
excludes - The exclude pattern.

setIncludes

void setIncludes(String includes)
Appends includes to the current list of include patterns. Patterns may be separated by a comma or a space.

For Example:

To include all files, including ones found in any sub directories and subsequent sub directories in the base directory of this fileset.

 setIncludes("**/*");
 
To include all files, with a txt extension, including ones found in any sub directories and subsequent sub directories in the base directory of this fileset.
 setIncludes("**/*.txt");
 

Parameters:
includes - The include pattern.

getSize

int getSize()
To get the number of files in the file set.

Returns:
The number of files in the file set.

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.