public class CanonicalFile extends java.io.File
getPath()
, getAbsolutePath()
and
getCanonicalPath()
all return the same (canonical) path.Constructor and Description |
---|
CanonicalFile(java.io.File file)
Create new canonical file from existing file.
|
CanonicalFile(java.io.File parent,
java.lang.String child)
Create new canonical file.
|
CanonicalFile(java.lang.String pathname)
Create new canonical file.
|
CanonicalFile(java.lang.String parent,
java.lang.String child)
Create new canonical file.
|
CanonicalFile(java.net.URI uri)
Create new canonical file.
|
Modifier and Type | Method and Description |
---|---|
CanonicalFile |
getAbsoluteFile()
Deprecated.
|
java.lang.String |
getAbsolutePath()
Deprecated.
|
CanonicalFile |
getCanonicalFile()
Returns the canonical file itself.
|
java.lang.String |
getCanonicalPath()
This method is overridden to save effort for call to
File.getCanonicalPath() . |
java.lang.String |
getExtension()
Returns the extension of the file.
|
CanonicalFile |
getParentFile()
Same as
File.getParentFile() but returns a canonical file. |
java.lang.String |
getPath()
Deprecated.
|
boolean |
isReadableFile()
Checks if this file is a file an can be read.
|
CanonicalFile[] |
listFiles()
Same as
File.listFiles() but returns canonical files. |
CanonicalFile[] |
listFiles(java.io.FileFilter filter)
Same as
File.listFiles(FileFilter) but returns canonical files. |
CanonicalFile[] |
listFiles(java.io.FilenameFilter filter)
Same as
File.listFiles(FilenameFilter) but returns canonical files. |
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getFreeSpace, getName, getParent, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
public CanonicalFile(java.io.File file) throws java.io.IOException
java.io.IOException
public CanonicalFile(java.lang.String pathname) throws java.io.IOException
java.io.IOException
File.File(String)
public CanonicalFile(java.io.File parent, java.lang.String child) throws java.io.IOException
java.io.IOException
File.File(File, String)
public CanonicalFile(java.lang.String parent, java.lang.String child) throws java.io.IOException
java.io.IOException
File.File(String, String)
public CanonicalFile(java.net.URI uri) throws java.io.IOException
java.io.IOException
File.File(URI)
@Deprecated public CanonicalFile getAbsoluteFile()
getCanonicalFile()
for
consistency reasons.getAbsoluteFile
in class java.io.File
public CanonicalFile getCanonicalFile()
getCanonicalFile
in class java.io.File
public CanonicalFile[] listFiles()
File.listFiles()
but returns canonical files. If for some
strange reason the files below a canonical file cannot be canonized, this may
throw an AssertionError
.
If this abstract pathname does not denote a directory, then this method
returns null
.listFiles
in class java.io.File
public CanonicalFile[] listFiles(java.io.FileFilter filter)
File.listFiles(FileFilter)
but returns canonical files. If
for some strange reason the files below a canonical file cannot be canonized,
this may throw an AssertionError
.
If this abstract pathname does not denote a directory, then this method
returns null
.listFiles
in class java.io.File
public CanonicalFile[] listFiles(java.io.FilenameFilter filter)
File.listFiles(FilenameFilter)
but returns canonical files.
If for some strange reason the files below a canonical file cannot be
canonized, this may throw an AssertionError
.
If this abstract pathname does not denote a directory, then this method
returns null
.listFiles
in class java.io.File
public CanonicalFile getParentFile()
File.getParentFile()
but returns a canonical file. If for
some strange reason the parent file of a canonical file cannot be canonized,
this may throw an AssertionError
.getParentFile
in class java.io.File
public boolean isReadableFile()
public java.lang.String getCanonicalPath()
File.getCanonicalPath()
.getCanonicalPath
in class java.io.File
@Deprecated public java.lang.String getAbsolutePath()
File.getAbsolutePath()
. Use getCanonicalPath()
for
consistency reasons.getAbsolutePath
in class java.io.File
@Deprecated public java.lang.String getPath()
getCanonicalPath()
for consistency reasons.getPath
in class java.io.File
public java.lang.String getExtension()
null
, if the file has no extension (i.e. if a filename
contains no '.'), returns the empty string if the '.' is the
filename's last character.