public class IoFile extends Object implements File
Modifier | Constructor and Description |
---|---|
protected |
IoFile(File ioFile) |
protected |
IoFile(File parent,
String child) |
protected |
IoFile(String pathname) |
protected |
IoFile(String parent,
String child) |
protected |
IoFile(URI uri) |
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 |
equals(Object obj) |
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() |
int |
hashCode() |
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
File.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 dest)
This is platform dependent (e.g.
|
boolean |
setExecutable(boolean executable) |
boolean |
setExecutable(boolean executable,
boolean ownerOnly) |
boolean |
setLastModified(long lastModified) |
boolean |
setLastModifiedNoFollow(long lastModified) |
boolean |
setReadable(boolean readable) |
boolean |
setReadable(boolean readable,
boolean ownerOnly) |
boolean |
setWritable(boolean writable) |
boolean |
setWritable(boolean writable,
boolean ownerOnly) |
String |
toString() |
URI |
toURI() |
public File getParentFile()
getParentFile
in interface File
public String[] list(FilenameFilter filenameFilter)
public File[] listFiles(FileFilter fileFilter)
public File[] listFiles(FileFilter fileFilter)
public File[] listFiles(FilenameFilter fileFilter)
public File getAbsoluteFile()
getAbsoluteFile
in interface File
public boolean existsNoFollow()
existsNoFollow
in interface File
public boolean createNewFile() throws IOException
createNewFile
in interface File
IOException
public boolean canExecute()
canExecute
in interface File
public boolean setExecutable(boolean executable)
setExecutable
in interface File
public boolean setExecutable(boolean executable, boolean ownerOnly)
setExecutable
in interface File
public boolean setReadable(boolean readable)
setReadable
in interface File
public boolean setReadable(boolean readable, boolean ownerOnly)
setReadable
in interface File
public boolean setWritable(boolean writable)
setWritable
in interface File
public boolean setWritable(boolean writable, boolean ownerOnly)
setWritable
in interface File
public void deleteOnExit()
deleteOnExit
in interface File
public void deleteRecursively()
deleteRecursively
in interface File
public String getAbsolutePath()
getAbsolutePath
in interface File
public File getCanonicalFile() throws IOException
getCanonicalFile
in interface File
IOException
public String getCanonicalPath() throws IOException
getCanonicalPath
in interface File
IOException
public long getFreeSpace()
getFreeSpace
in interface File
public boolean isRegularFileNoFollowLinks()
isRegularFileNoFollowLinks
in interface File
public boolean isRegularFileFollowLinks()
isRegularFileFollowLinks
in interface File
public boolean isDirectoryNoFollowSymLinks()
isDirectoryNoFollowSymLinks
in interface File
public boolean isDirectoryFollowSymLinks()
isDirectoryFollowSymLinks
in interface File
public boolean isSymbolicLink()
isSymbolicLink
in interface File
public String readSymbolicLinkToPathString() throws IOException
File
readSymbolicLinkToPathString
in interface File
IOException
public long getLastModifiedNoFollow()
getLastModifiedNoFollow
in interface File
public boolean renameTo(File dest)
File
File.renameTo(java.io.File)
.public boolean setLastModified(long lastModified)
setLastModified
in interface File
public IOutputStream createOutputStream() throws FileNotFoundException
createOutputStream
in interface File
FileNotFoundException
public IInputStream createInputStream() throws FileNotFoundException
createInputStream
in interface File
FileNotFoundException
public IOutputStream createOutputStream(boolean append) throws FileNotFoundException
createOutputStream
in interface File
FileNotFoundException
public void createSymbolicLink(String targetPath) throws IOException
createSymbolicLink
in interface File
IOException
public long lastModified()
lastModified
in interface File
public boolean isAbsolute()
isAbsolute
in interface File
public boolean isDirectory()
isDirectory
in interface File
public void move(File toFile) throws IOException
File
File.renameTo(File)
respectively File.renameTo(java.io.File)
.move
in interface File
IOException
public void copyToCopyAttributes(File toFile) throws IOException
File
copyToCopyAttributes
in interface File
IOException
public RandomAccessFile createRandomAccessFile(String mode) throws FileNotFoundException
createRandomAccessFile
in interface File
FileNotFoundException
public boolean setLastModifiedNoFollow(long lastModified)
setLastModifiedNoFollow
in interface File
public String relativize(File target) throws IOException
relativize
in interface File
IOException
public long getUsableSpace()
getUsableSpace
in interface File
public File getIoFile()
File
public File createFile(String... children)
File
File
.
This method appends sub-path-elements. It is synonymous to
createFile(thisFile, children)
and more intuitive.
createFile
in interface File
children
- the children to be appended. May be null
or empty.File
. Never null
.Copyright © 2013–2019. All rights reserved.