net.i2p.util
Class SecureFile
java.lang.Object
java.io.File
net.i2p.util.SecureDirectory
net.i2p.util.SecureFile
- All Implemented Interfaces:
- Serializable, Comparable<File>
public class SecureFile
- extends SecureDirectory
Same as SecureDirectory but sets the file mode after createNewFile()
and createTempFile() also. So just use this instead.
Probably should have just made this class in the beginning and not had two.
- Since:
- 0.8.2
- Author:
- zzz
- See Also:
- Serialized Form
Methods inherited from class java.io.File |
canExecute, canRead, canWrite, compareTo, 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, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL |
SecureFile
public SecureFile(String pathname)
SecureFile
public SecureFile(String parent,
String child)
SecureFile
public SecureFile(File parent,
String child)
createNewFile
public boolean createNewFile()
throws IOException
- Sets file to mode 600 if the file is created
- Overrides:
createNewFile
in class File
- Throws:
IOException
createTempFile
public static File createTempFile(String prefix,
String suffix)
throws IOException
- Sets file to mode 600 when the file is created
- Throws:
IOException
createTempFile
public static File createTempFile(String prefix,
String suffix,
File directory)
throws IOException
- Sets file to mode 600 when the file is created
- Throws:
IOException
setPerms
protected void setPerms()
- Tries to set the permissions to 600,
ignores errors
- Overrides:
setPerms
in class SecureDirectory