Package 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
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SecureFile(File parent, String child)
SecureFile(String pathname)
SecureFile(String parent, String child)
-
Method Summary
Modifier and Type Method Description boolean
createNewFile()
Sets file to mode 600 if the file is createdstatic File
createTempFile(String prefix, String suffix)
Sets file to mode 600 when the file is createdstatic File
createTempFile(String prefix, String suffix, File directory)
Sets file to mode 600 when the file is createdprotected void
setPerms()
Tries to set the permissions to 600, ignores errorsMethods 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, toPath, toString, toURI, toURL
-
Constructor Details
-
Method Details
-
createNewFile
Sets file to mode 600 if the file is created- Overrides:
createNewFile
in classFile
- Throws:
IOException
-
createTempFile
Sets file to mode 600 when the file is created- Throws:
IOException
-
createTempFile
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 classSecureDirectory
-