public class NioFile extends IoFile implements File
Modifier | Constructor and Description |
---|---|
protected |
NioFile(File ioFile) |
protected |
NioFile(File parent,
String child) |
protected |
NioFile(String pathname) |
protected |
NioFile(String parent,
String child) |
protected |
NioFile(URI uri) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(File otherFile) |
void |
copyToCopyAttributes(File toFile)
Copies a file, a symlink (depends on environment/implementation) or a directory (non-recursive).
|
void |
createSymbolicLink(String targetPath) |
boolean |
existsNoFollow() |
File |
getAbsoluteFile() |
File |
getCanonicalFile() |
long |
getLastModifiedNoFollow() |
File |
getParentFile() |
boolean |
isDirectoryFollowSymLinks() |
boolean |
isDirectoryNoFollowSymLinks() |
boolean |
isRegularFileFollowLinks() |
boolean |
isRegularFileNoFollowLinks() |
boolean |
isSymbolicLink() |
long |
lastModified() |
File[] |
listFiles() |
File[] |
listFiles(FileFilter fileFilter) |
File[] |
listFiles(FilenameFilter fileFilter) |
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 |
setLastModified(long lastModified) |
boolean |
setLastModifiedNoFollow(long lastModified) |
canExecute, canRead, canWrite, createFile, createInputStream, createNewFile, createOutputStream, createOutputStream, createRandomAccessFile, delete, deleteOnExit, deleteRecursively, equals, exists, getAbsolutePath, getCanonicalPath, getFreeSpace, getIoFile, getName, getPath, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, length, list, list, listFiles, mkdir, mkdirs, setExecutable, setExecutable, setReadable, setReadable, setWritable, setWritable, toString, toURI
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
canExecute, canRead, canWrite, createFile, createInputStream, createNewFile, createOutputStream, createOutputStream, createRandomAccessFile, delete, deleteOnExit, deleteRecursively, exists, getAbsolutePath, getCanonicalPath, getFreeSpace, getIoFile, getName, getPath, getUsableSpace, isAbsolute, isDirectory, isFile, length, list, list, listFiles, mkdir, mkdirs, setExecutable, setExecutable, setReadable, setReadable, setWritable, setWritable, toURI
public File getParentFile()
getParentFile
in interface File
getParentFile
in class IoFile
public File[] listFiles(FileFilter fileFilter)
public File[] listFiles(FilenameFilter fileFilter)
public File getAbsoluteFile()
getAbsoluteFile
in interface File
getAbsoluteFile
in class IoFile
public boolean existsNoFollow()
existsNoFollow
in interface File
existsNoFollow
in class IoFile
public File getCanonicalFile() throws IOException
getCanonicalFile
in interface File
getCanonicalFile
in class IoFile
IOException
public boolean isRegularFileNoFollowLinks()
isRegularFileNoFollowLinks
in interface File
isRegularFileNoFollowLinks
in class IoFile
public boolean isRegularFileFollowLinks()
isRegularFileFollowLinks
in interface File
isRegularFileFollowLinks
in class IoFile
public boolean isDirectoryNoFollowSymLinks()
isDirectoryNoFollowSymLinks
in interface File
isDirectoryNoFollowSymLinks
in class IoFile
public boolean isDirectoryFollowSymLinks()
isDirectoryFollowSymLinks
in interface File
isDirectoryFollowSymLinks
in class IoFile
public boolean isSymbolicLink()
isSymbolicLink
in interface File
isSymbolicLink
in class IoFile
public String readSymbolicLinkToPathString() throws IOException
File
readSymbolicLinkToPathString
in interface File
readSymbolicLinkToPathString
in class IoFile
IOException
public long lastModified()
lastModified
in interface File
lastModified
in class IoFile
public long getLastModifiedNoFollow()
getLastModifiedNoFollow
in interface File
getLastModifiedNoFollow
in class IoFile
public boolean renameTo(File dest)
File
File.renameTo(java.io.File)
.public void createSymbolicLink(String targetPath) throws IOException
createSymbolicLink
in interface File
createSymbolicLink
in class IoFile
IOException
public void move(File toFile) throws IOException
File
File.renameTo(File)
respectively File.renameTo(java.io.File)
.move
in interface File
move
in class IoFile
IOException
public void copyToCopyAttributes(File toFile) throws IOException
File
copyToCopyAttributes
in interface File
copyToCopyAttributes
in class IoFile
IOException
public boolean setLastModified(long lastModified)
setLastModified
in interface File
setLastModified
in class IoFile
public boolean setLastModifiedNoFollow(long lastModified)
setLastModifiedNoFollow
in interface File
setLastModifiedNoFollow
in class IoFile
public String relativize(File target)
relativize
in interface File
relativize
in class IoFile
Copyright © 2013–2019. All rights reserved.