|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.File
edu.tum.cs.commons.filesystem.CanonicalFile
public class CanonicalFile
This class represents files that are guaranteed to be canonical. For this
class methods getPath()
, getAbsolutePath()
and
getCanonicalPath()
all return the same (canonical) path.
Field Summary |
---|
Fields inherited from class java.io.File |
---|
pathSeparator, pathSeparatorChar, separator, separatorChar |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.io.File |
---|
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, toString, toURI, toURL |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
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)
Method Detail |
---|
@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
.
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
.
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
.
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.
|
TUM CCSM Commons | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |