public class LastDirectories extends FileNamerIndependent
The subdirectory names to use are limited by a certain number, working backwards from the filename to the file-system root.
Constructor and Description |
---|
LastDirectories() |
LastDirectories(int numberSubdirectories)
Creates for a particular number of subdirectories.
|
Modifier and Type | Method and Description |
---|---|
void |
checkMisconfigured(BeanInstanceMap defaultInstances)
Checks that a bean's properties conform to expectations.
|
protected String |
deriveName(File file,
Optional<Path> inputDirectory,
int index)
Derives a unique name for this file.
|
int |
getNumberSubdirectories()
How many directories to include in the name.
|
int |
getSkipNumberSubdirectories()
Initially skip this number of directories before including them in the description.
|
boolean |
isRemoveExtensionInDescription()
Whether to remove the file-extension from the filename.
|
boolean |
isSkipFileName()
Iff true the filename is not considered, only the subdirectories.
|
void |
setNumberSubdirectories(int numberSubdirectories)
How many directories to include in the name.
|
void |
setRemoveExtensionInDescription(boolean removeExtensionInDescription)
Whether to remove the file-extension from the filename.
|
void |
setSkipFileName(boolean skipFileName)
Iff true the filename is not considered, only the subdirectories.
|
void |
setSkipNumberSubdirectories(int skipNumberSubdirectories)
Initially skip this number of directories before including them in the description.
|
deriveName
deriveName, deriveNameUnique
describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
public LastDirectories(int numberSubdirectories)
numberSubdirectories
- the number of subdirectoriespublic LastDirectories()
public void checkMisconfigured(BeanInstanceMap defaultInstances) throws BeanMisconfiguredException
AnchorBean
checkMisconfigured
in class AnchorBean<FileNamer>
defaultInstances
- all available default instances if the DefaultInstance
annotation is usedBeanMisconfiguredException
- if the bean has not been configured properly as XMLprotected String deriveName(File file, Optional<Path> inputDirectory, int index)
FileNamerIndependent
deriveName
in class FileNamerIndependent
file
- the file.inputDirectory
- the root input-directory used in naming.index
- a unique incrementing number, beginning at zero, passed to each call to this
method within a collection.public int getNumberSubdirectories()
This refers to the last-most sub-directories i.e. working backwards from the filename to the file-system root.
public void setNumberSubdirectories(int numberSubdirectories)
This refers to the last-most sub-directories i.e. working backwards from the filename to the file-system root.
public boolean isRemoveExtensionInDescription()
public void setRemoveExtensionInDescription(boolean removeExtensionInDescription)
public int getSkipNumberSubdirectories()
This refers to the last-most directories i.e. working backwards from the filename to the file-system root.
public void setSkipNumberSubdirectories(int skipNumberSubdirectories)
This refers to the last-most directories i.e. working backwards from the filename to the file-system root.
public boolean isSkipFileName()
public void setSkipFileName(boolean skipFileName)
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.