This task takes file and turns them into a URL, which it then assigns to a property. Use when for setting up RMI codebases.
nested filesets are supported; if present, these are turned into the url with the given separator between them (default = " ").
| Modifier and Type | Field and Description |
|---|---|
| public static final String | ERROR_MISSING_FILE
Missing file |
| public static final String | ERROR_NO_FILES
No files defined |
| public static final String | ERROR_NO_PROPERTY
No property defined |
| private File | file
name of a file to turn into a URL |
| private List | filesets
filesets of nested files to add to this url |
| private List | paths
paths to add |
| private String | property
name of the property to set |
| private String | separator
separator char |
| private boolean | validate
validation flag |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addFileSet(FileSet
the fileset to be added. fileset)a fileset of jar files to include in the URL, each separated by the separator |
| public void | |
| public void | |
| private String | |
| private String | |
| public void | |
| public void | setProperty(String
the name of the property. property)set the name of a property to fill with the URL |
| public void | |
| public void | setValidate(boolean
a validate)boolean value.set this flag to trigger validation that every named file exists. |
| private String | Returns: trimmed string, or empty stringURL buffer urls, int number of URL entries count)convert the string buffer to a string, potentially stripping out any trailing separator |
| private String | |
| private void | |
| private void | validateFile(File
file that may need to exist fileToCheck)verify that the file exists, if |
| ERROR_MISSING_FILE | back to summary |
|---|---|
| public static final String ERROR_MISSING_FILE Missing file | |
| ERROR_NO_FILES | back to summary |
|---|---|
| public static final String ERROR_NO_FILES No files defined | |
| ERROR_NO_PROPERTY | back to summary |
|---|---|
| public static final String ERROR_NO_PROPERTY No property defined | |
| file | back to summary |
|---|---|
| private File file name of a file to turn into a URL | |
| filesets | back to summary |
|---|---|
| private List<FileSet> filesets filesets of nested files to add to this url | |
| paths | back to summary |
|---|---|
| private List<Path> paths paths to add | |
| property | back to summary |
|---|---|
| private String property name of the property to set | |
| separator | back to summary |
|---|---|
| private String separator separator char | |
| validate | back to summary |
|---|---|
| private boolean validate validation flag | |
| MakeUrl | back to summary |
|---|---|
| public MakeUrl() | |
| addFileSet | back to summary |
|---|---|
| public void addFileSet(FileSet fileset) a fileset of jar files to include in the URL, each separated by the separator
| |
| addPath | back to summary |
|---|---|
| public void addPath(Path path) add a path to the URL. All elements in the path will be converted to individual URL entries
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Create the url
| |
| filesetsToURL | back to summary |
|---|---|
| private String filesetsToURL() convert the filesets to urls.
| |
| pathsToURL | back to summary |
|---|---|
| private String pathsToURL() convert all paths to URLs
| |
| setFile | back to summary |
|---|---|
| public void setFile(File file) the name of a file to be converted into a URL
| |
| setProperty | back to summary |
|---|---|
| public void setProperty(String property) set the name of a property to fill with the URL
| |
| setSeparator | back to summary |
|---|---|
| public void setSeparator(String separator) set the separator for the multi-url option.
| |
| setValidate | back to summary |
|---|---|
| public void setValidate(boolean validate) set this flag to trigger validation that every named file exists. Optional: default=true
| |
| stripTrailingSeparator | back to summary |
|---|---|
| private String stripTrailingSeparator(StringBuilder urls, int count) convert the string buffer to a string, potentially stripping out any trailing separator
| |
| toURL | back to summary |
|---|---|
| private String toURL(File fileToConvert) convert a file to a URL; | |
| validate | back to summary |
|---|---|
| private void validate() check for errors
| |
| validateFile | back to summary |
|---|---|
| private void validateFile(File fileToCheck) verify that the file exists, if
| |