Package com.biglybt.core.util
Class FileHandler
- java.lang.Object
-
- com.biglybt.core.util.FileHandler
-
- Direct Known Subclasses:
FileUtil.FileHandlerHack
public class FileHandler extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description FileHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsPathSegment(java.io.File f, java.lang.String path, boolean caseSensitive)
java.io.File
getCanonicalFileSafe(java.io.File file)
Preserves the case of the file.name when the file exists but differs in casejava.lang.String
getCanonicalPathSafe(java.io.File file)
Preserves the case of the file.name when the file exists but differs in casejava.lang.String
getRelativePath(java.io.File parentDir, java.io.File file)
boolean
isAncestorOf(java.io.File _parent, java.io.File _child)
Whether child in an ancestor of parent, or child IS parentjava.io.File
newFile(java.io.File parent, java.lang.String... subDirs)
java.io.File
newFile(java.lang.String parent, java.lang.String... subDirs)
java.io.File
newFile(java.net.URI uri)
FMFileAccess.FileAccessor
newFileAccessor(java.io.File file, java.lang.String access_mode)
java.io.FileInputStream
newFileInputStream(java.io.File from_file)
java.io.FileOutputStream
newFileOutputStream(java.io.File file, boolean append)
-
-
-
Method Detail
-
newFile
public java.io.File newFile(java.io.File parent, java.lang.String... subDirs)
-
newFile
public java.io.File newFile(java.lang.String parent, java.lang.String... subDirs)
-
newFile
public java.io.File newFile(java.net.URI uri)
-
newFileOutputStream
public java.io.FileOutputStream newFileOutputStream(java.io.File file, boolean append) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
newFileInputStream
public java.io.FileInputStream newFileInputStream(java.io.File from_file) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
newFileAccessor
public FMFileAccess.FileAccessor newFileAccessor(java.io.File file, java.lang.String access_mode) throws java.io.FileNotFoundException
- Throws:
java.io.FileNotFoundException
-
containsPathSegment
public boolean containsPathSegment(java.io.File f, java.lang.String path, boolean caseSensitive)
-
getRelativePath
public java.lang.String getRelativePath(java.io.File parentDir, java.io.File file)
- Returns:
- path string relative to
parentDir
.
null
if file is not in parentDir.
Empty String if file is parentDir.
-
getCanonicalFileSafe
public java.io.File getCanonicalFileSafe(java.io.File file)
Preserves the case of the file.name when the file exists but differs in case
-
getCanonicalPathSafe
public java.lang.String getCanonicalPathSafe(java.io.File file)
Preserves the case of the file.name when the file exists but differs in case
-
isAncestorOf
public boolean isAncestorOf(java.io.File _parent, java.io.File _child)
Whether child in an ancestor of parent, or child IS parent
-
-