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
-
Fields inherited from class net.i2p.util.SecureDirectory
isNotWindows
-
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar
-
-
Constructor Summary
Constructors Constructor Description SecureFile(File parent, String child)
SecureFile(String pathname)
SecureFile(String parent, String child)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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 errors-
Methods inherited from class net.i2p.util.SecureDirectory
mkdir, mkdirs
-
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, toPath, toString, toURI, toURL
-
-
-
-
Method Detail
-
createNewFile
public boolean createNewFile() throws IOException
Sets file to mode 600 if the file is created- Overrides:
createNewFile
in classFile
- 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 classSecureDirectory
-
-