Package org.nuxeo.common.utils
Class FileRef
- java.lang.Object
-
- org.nuxeo.common.utils.FileRef
-
- Direct Known Subclasses:
FileRef.ExactFileRef,FileRef.PatternFileRef
public abstract class FileRef extends Object
A file reference that can handle file name patterns. A file pattern can use named variable that will be substituted with the actual value of the file that matched the pattern.Example: For a file pattern
nuxeo-automation-core-{v:.*}.jarthat will match a file namednuxeo-automation-core-5.3.2.jarthe pattern variable will bev=5.3.2.Note that only one pattern variable is supported.
- Author:
- Bogdan Stefanescu
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFileRef.ExactFileRefstatic classFileRef.PatternFileRef
-
Constructor Summary
Constructors Constructor Description FileRef()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidfillPatternVariables(Map<String,Object> vars)Fill the given map with pattern variables.abstract FilegetFile()Gets the file referenced by this object.abstract booleanhasPattern()Whether the referred file has a name pattern.static FileRefnewFileRef(File file)static FileRefnewFileRef(String path)
-
-
-
Method Detail
-
getFile
public abstract File getFile()
Gets the file referenced by this object. If the FileRef could not be resolved then null is returned.- Returns:
- the referred file or null if none was found.
-
hasPattern
public abstract boolean hasPattern()
Whether the referred file has a name pattern.
-
-