public class MustFile
extends java.io.File
Constructor and Description |
---|
MustFile(java.io.File file) |
MustFile(java.io.File parent,
java.lang.String child) |
MustFile(java.lang.String pathname) |
MustFile(java.lang.String parent,
java.lang.String child) |
MustFile(java.net.URI uri) |
Modifier and Type | Method and Description |
---|---|
boolean |
canWrite() |
java.lang.String |
chooseSuitableCharset(java.lang.String[] charsetOptions)
Returns a suitable charset name to read the file, trying in the order of charsetOptions.
|
static boolean |
isImageExtension(java.lang.String extension) |
boolean |
isSuitable(java.lang.String charsetName)
Returns true if the specified charset is suitable to read the file (doesn't throw any CharacterCodingException)
Performance hint: this method will read the entire file to ensure there is no exception at all
|
canExecute, canRead, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toPath, toString, toURI, toURL
public MustFile(java.io.File file)
public MustFile(java.lang.String pathname)
public MustFile(java.net.URI uri)
public MustFile(java.lang.String parent, java.lang.String child)
public MustFile(java.io.File parent, java.lang.String child)
public static boolean isImageExtension(java.lang.String extension)
public boolean canWrite()
canWrite
in class java.io.File
public java.lang.String chooseSuitableCharset(java.lang.String[] charsetOptions)
charsetOptions
- the names of the charsets to be testedpublic boolean isSuitable(java.lang.String charsetName) throws java.io.IOException
charsetName
- the name of the charset to be testedjava.io.IOException
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de