Class PlaceholderDirectory
- java.lang.Object
-
- java.io.File
-
- adams.core.io.PlaceholderFile
-
- adams.core.io.PlaceholderDirectory
-
- All Implemented Interfaces:
Serializable
,Comparable<File>
public class PlaceholderDirectory extends PlaceholderFile
A specialized File class used for selecting directories with the GOE.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
-
-
Constructor Summary
Constructors Constructor Description PlaceholderDirectory()
Creates a newPlaceholderFile
instance by using the given file.PlaceholderDirectory(File file)
Creates a newPlaceholderDirectory
instance by using the given file.PlaceholderDirectory(File parent, String child)
Creates a newFile
instance from a parent abstract pathname and a child pathname string.PlaceholderDirectory(String pathname)
Creates a newFile
instance by converting the given pathname string into an abstract pathname.PlaceholderDirectory(String parent, String child)
Creates a newFile
instance from a parent pathname string and a child pathname string.PlaceholderDirectory(URI uri)
Creates a new File instance by converting the given file: URI into an abstract pathname.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlaceholderFile
createFile(String name)
Creates a file object using this directory and the specified name.-
Methods inherited from class adams.core.io.PlaceholderFile
canExecute, canRead, canWrite, changeExtension, changeExtension, compareTo, createNewFile, delete, deleteOnExit, exists, expand, fixSeparator, fixSeparator, getAbsolutePath, getCanonicalPath, getExtension, getExtension, getFreeSpace, getParent, getParentFile, getTotalSpace, getUsableSpace, isAbsolute, isDirectory, isFile, isHidden, isValid, isValid, lastModified, length, list, list, listFiles, listFiles, listFiles, mkdir, renameTo, setExecutable, setLastModified, setReadable, setReadOnly, setWritable, toPath, toPlaceholderFiles
-
Methods inherited from class java.io.File
createTempFile, createTempFile, equals, getAbsoluteFile, getCanonicalFile, getName, getPath, hashCode, list, listRoots, mkdirs, setExecutable, setReadable, setWritable, toString, toURI, toURL
-
-
-
-
Constructor Detail
-
PlaceholderDirectory
public PlaceholderDirectory()
Creates a newPlaceholderFile
instance by using the given file.
-
PlaceholderDirectory
public PlaceholderDirectory(File file)
Creates a newPlaceholderDirectory
instance by using the given file.- Parameters:
file
- the file to use
-
PlaceholderDirectory
public PlaceholderDirectory(String pathname)
Creates a newFile
instance by converting the given pathname string into an abstract pathname. If the given string is the empty string, then the result is the empty abstract pathname.- Parameters:
pathname
- A pathname string
-
PlaceholderDirectory
public PlaceholderDirectory(String parent, String child)
Creates a newFile
instance from a parent pathname string and a child pathname string.If
parent
isnull
then the newFile
instance is created as if by invoking the single-argumentFile
constructor on the givenchild
pathname string.Otherwise the
parent
pathname string is taken to denote a directory, and thechild
pathname string is taken to denote either a directory or a file. If thechild
pathname string is absolute then it is converted into a relative pathname in a system-dependent way. Ifparent
is the empty string then the newFile
instance is created by convertingchild
into an abstract pathname and resolving the result against a system-dependent default directory. Otherwise each pathname string is converted into an abstract pathname and the child abstract pathname is resolved against the parent.- Parameters:
parent
- The parent pathname stringchild
- The child pathname string
-
PlaceholderDirectory
public PlaceholderDirectory(File parent, String child)
Creates a newFile
instance from a parent abstract pathname and a child pathname string.If
parent
isnull
then the newFile
instance is created as if by invoking the single-argumentFile
constructor on the givenchild
pathname string.Otherwise the
parent
abstract pathname is taken to denote a directory, and thechild
pathname string is taken to denote either a directory or a file. If thechild
pathname string is absolute then it is converted into a relative pathname in a system-dependent way. Ifparent
is the empty abstract pathname then the newFile
instance is created by convertingchild
into an abstract pathname and resolving the result against a system-dependent default directory. Otherwise each pathname string is converted into an abstract pathname and the child abstract pathname is resolved against the parent.- Parameters:
parent
- The parent abstract pathnamechild
- The child pathname string
-
PlaceholderDirectory
public PlaceholderDirectory(URI uri)
Creates a new File instance by converting the given file: URI into an abstract pathname.The exact form of a file: URI is system-dependent, hence the transformation performed by this constructor is also system-dependent.
For a given abstract pathname f it is guaranteed that
new File( f.
so long as the original abstract pathname, the URI, and the new abstract pathname are all created in (possibly different invocations of) the same Java virtual machine. This relationship typically does not hold, however, when a file: URI that is created in a virtual machine on one operating system is converted into an abstract pathname in a virtual machine on a different operating system.toURI
()).equals( f.getAbsoluteFile
())- Parameters:
uri
- An absolute, hierarchical URI with a scheme equal to "file", a non-empty path component, and undefined authority, query, and fragment components
-
-
Method Detail
-
createFile
public PlaceholderFile createFile(String name)
Creates a file object using this directory and the specified name.- Parameters:
name
- the filename (no path)- Returns:
- the combine dir/filename
-
-