public interface File extends Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
canExecute() |
boolean |
canRead() |
boolean |
canWrite() |
int |
compareTo(File otherFile) |
void |
copyToCopyAttributes(File toFile)
Copies a file, a symlink (depends on environment/implementation) or a directory (non-recursive).
|
File |
createFile(String... children)
Create a child-
File . |
IInputStream |
createInputStream() |
boolean |
createNewFile() |
IOutputStream |
createOutputStream() |
IOutputStream |
createOutputStream(boolean append) |
RandomAccessFile |
createRandomAccessFile(String mode) |
void |
createSymbolicLink(String targetPath) |
boolean |
delete() |
void |
deleteOnExit() |
void |
deleteRecursively() |
boolean |
exists() |
boolean |
existsNoFollow() |
File |
getAbsoluteFile() |
String |
getAbsolutePath() |
File |
getCanonicalFile() |
String |
getCanonicalPath() |
long |
getFreeSpace() |
File |
getIoFile()
Caution: Only use this when forced by 3rd party interface!
|
long |
getLastModifiedNoFollow() |
String |
getName() |
File |
getParentFile() |
String |
getPath() |
long |
getUsableSpace() |
boolean |
isAbsolute() |
boolean |
isDirectory() |
boolean |
isDirectoryFollowSymLinks() |
boolean |
isDirectoryNoFollowSymLinks() |
boolean |
isFile() |
boolean |
isRegularFileFollowLinks() |
boolean |
isRegularFileNoFollowLinks() |
boolean |
isSymbolicLink() |
long |
lastModified() |
long |
length() |
String[] |
list() |
String[] |
list(FilenameFilter filenameFilter) |
File[] |
listFiles() |
File[] |
listFiles(FileFilter fileFilter) |
File[] |
listFiles(FileFilter fileFilter) |
File[] |
listFiles(FilenameFilter fileFilter) |
boolean |
mkdir() |
boolean |
mkdirs() |
void |
move(File toFile)
This is platform independent, in contrast to
renameTo(File) respectively File.renameTo(java.io.File) . |
String |
readSymbolicLinkToPathString()
Convenience method for the often called chain:
java.io.File --> java.nio.Path --> Files.readSymbolicLink --> IOUtil.toPathString
Without symlinks, this method would not be needed.
|
String |
relativize(File target) |
boolean |
renameTo(File newFileName)
This is platform dependent (e.g.
|
boolean |
setExecutable(boolean executable) |
boolean |
setExecutable(boolean executable,
boolean ownerOnly) |
boolean |
setLastModified(long lastModified) |
boolean |
setLastModifiedNoFollow(long time) |
boolean |
setReadable(boolean readable) |
boolean |
setReadable(boolean readable,
boolean ownerOnly) |
boolean |
setWritable(boolean writable) |
boolean |
setWritable(boolean writable,
boolean ownerOnly) |
URI |
toURI() |
String[] list(FilenameFilter filenameFilter)
File[] listFiles(FileFilter fileFilter)
File[] listFiles(FileFilter fileFilter)
File[] listFiles(FilenameFilter fileFilter)
File createFile(String... children)
File
.
This method appends sub-path-elements. It is synonymous to
createFile(thisFile, children)
and more intuitive.
children
- the children to be appended. May be null
or empty.File
. Never null
.File getAbsoluteFile()
File getParentFile()
boolean isSymbolicLink()
boolean canWrite()
boolean canRead()
boolean canExecute()
boolean setExecutable(boolean executable)
boolean setReadable(boolean readable)
boolean setReadable(boolean readable, boolean ownerOnly)
boolean setWritable(boolean writable)
boolean setWritable(boolean writable, boolean ownerOnly)
String readSymbolicLinkToPathString() throws IOException
IOException
boolean exists()
boolean existsNoFollow()
boolean createNewFile() throws IOException
IOException
boolean delete()
void deleteOnExit()
void deleteRecursively()
long getFreeSpace()
String getCanonicalPath() throws IOException
IOException
File getCanonicalFile() throws IOException
IOException
String getAbsolutePath()
boolean isRegularFileFollowLinks()
boolean isRegularFileNoFollowLinks()
boolean mkdir()
boolean isDirectory()
boolean isDirectoryNoFollowSymLinks()
boolean isDirectoryFollowSymLinks()
long getUsableSpace()
long length()
boolean renameTo(File newFileName)
File.renameTo(java.io.File)
.boolean setLastModified(long lastModified)
IOutputStream createOutputStream() throws FileNotFoundException
FileNotFoundException
IOutputStream createOutputStream(boolean append) throws FileNotFoundException
FileNotFoundException
IInputStream createInputStream() throws FileNotFoundException
FileNotFoundException
void createSymbolicLink(String targetPath) throws IOException
IOException
long lastModified()
long getLastModifiedNoFollow()
boolean isAbsolute()
boolean mkdirs()
void copyToCopyAttributes(File toFile) throws IOException
IOException
void move(File toFile) throws IOException
renameTo(File)
respectively File.renameTo(java.io.File)
.IOException
RandomAccessFile createRandomAccessFile(String mode) throws FileNotFoundException
FileNotFoundException
boolean isFile()
boolean setLastModifiedNoFollow(long time)
String relativize(File target) throws IOException
IOException
boolean setExecutable(boolean executable, boolean ownerOnly)
Copyright © 2013–2019. All rights reserved.