Package org.openbase.jps.preset
Class AbstractJPFile
- java.lang.Object
-
- org.openbase.jps.core.AbstractJavaProperty<File>
-
- org.openbase.jps.preset.AbstractJPFile
-
- All Implemented Interfaces:
Comparable<AbstractJavaProperty>
- Direct Known Subclasses:
AbstractJPDirectory,JPPropertyFile
public abstract class AbstractJPFile extends AbstractJavaProperty<File>
- Author:
- Divine Threepwood
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openbase.jps.core.AbstractJavaProperty
AbstractJavaProperty.ValueType
-
-
Field Summary
-
Fields inherited from class org.openbase.jps.core.AbstractJavaProperty
argumentIdentifiers, arguments, identifier, logger, propertyIdentifiers
-
-
Constructor Summary
Constructors Constructor Description AbstractJPFile(String[] commandIdentifier, FileHandler.ExistenceHandling existenceHandling, FileHandler.AutoMode autoCreateMode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringconvertIntoValidFileName(String filename)protected String[]generateArgumentIdentifiers()FileHandler.AutoModegetAutoCreateMode()FileHandler.ExistenceHandlinggetExistenceHandling()FilegetParentDirectory()FileHandler.FileTypegetType()protected Fileparse(List<String> arguments)protected voidsetAutoCreateMode(FileHandler.AutoMode autoCreateMode)protected voidsetExistenceHandling(FileHandler.ExistenceHandling existenceHandling)protected voidsetValue(File value, AbstractJavaProperty.ValueType valueType)StringtoString()voidvalidate()Can be overwritten for value validation.-
Methods inherited from class org.openbase.jps.core.AbstractJavaProperty
addArgument, addErrorReport, checkArgumentCount, checkArgumentCount, checkArgumentCountMax, checkArgumentCountMin, compareTo, getArgumentIdentifiers, getDefaultExample, getDefaultValue, getDependencyList, getDescription, getErrorReport, getErrorReportMap, getOneArgumentResult, getPropertyDefaultValue, getPropertyIdentifiers, getSyntax, getValue, getValueType, isIdentified, isIdentifiered, isParsed, loadAction, match, neetToBeParsed, overwriteDefaultValue, parseArguments, registerDependingProperty, reset, update, updateValue
-
-
-
-
Constructor Detail
-
AbstractJPFile
public AbstractJPFile(String[] commandIdentifier, FileHandler.ExistenceHandling existenceHandling, FileHandler.AutoMode autoCreateMode)
-
-
Method Detail
-
generateArgumentIdentifiers
protected String[] generateArgumentIdentifiers()
- Specified by:
generateArgumentIdentifiersin classAbstractJavaProperty<File>
-
parse
protected File parse(List<String> arguments) throws Exception
- Specified by:
parsein classAbstractJavaProperty<File>- Throws:
Exception
-
validate
public void validate() throws JPValidationExceptionDescription copied from class:AbstractJavaPropertyCan be overwritten for value validation. Method is called after parsing.- Overrides:
validatein classAbstractJavaProperty<File>- Throws:
JPValidationException
-
setValue
protected void setValue(File value, AbstractJavaProperty.ValueType valueType)
- Overrides:
setValuein classAbstractJavaProperty<File>
-
getAutoCreateMode
public FileHandler.AutoMode getAutoCreateMode()
-
setAutoCreateMode
protected void setAutoCreateMode(FileHandler.AutoMode autoCreateMode)
-
getExistenceHandling
public FileHandler.ExistenceHandling getExistenceHandling()
-
setExistenceHandling
protected void setExistenceHandling(FileHandler.ExistenceHandling existenceHandling)
-
getType
public FileHandler.FileType getType()
-
getParentDirectory
public File getParentDirectory() throws JPServiceException
- Returns:
- the parent dir or null if the no parent exist. Method can be overwritten to defining the parent dir.
- Throws:
JPServiceException- in case the parent directory is not available.
-
toString
public String toString()
- Overrides:
toStringin classAbstractJavaProperty<File>
-
-