Class RestrictedFileUtils
java.lang.Object
net.sourceforge.jnlp.util.RestrictedFileUtils
This class contains a method to create restricted files.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidcreateFileOrDir(File file, boolean isDir) static voidcreateRestrictedDirectory(File directory) Creates a new directory with minimum permissions.static voidcreateRestrictedFile(File file) Creates a new file with minimum permissions.private static voidcreateRestrictedFile(File file, boolean isDir) Creates a new file or directory with minimum permissions.private static MethodfindMethod(Class<?> clazz, String methodName) static StringgetSIDForPrincipal(Principal principal) static booleanprincipalInWinSIDS(Principal principal)
-
Field Details
-
LOG
-
WIN_PRINCIPAL_SIDS
-
-
Constructor Details
-
RestrictedFileUtils
public RestrictedFileUtils()
-
-
Method Details
-
createRestrictedDirectory
Creates a new directory with minimum permissions. The directory is not readable or writable by anyone other than the owner. The parent directories are not created; they must exist before this is called.- Parameters:
directory- directory to be created- Throws:
IOException- if IO fails
-
createRestrictedFile
Creates a new file with minimum permissions. The file is not readable or writable by anyone other than the owner. If writeableByOwner is false, even the owner can not write to it.- Parameters:
file- path to file- Throws:
IOException- if IO fails
-
createRestrictedFile
Creates a new file or directory with minimum permissions. The file is not readable or writable by anyone other than the owner. If writeableByOwner is false, even the owner can not write to it. If isDir is true, then the directory can be executed by the owner- Throws:
IOException
-
createFileOrDir
- Throws:
IOException
-
principalInWinSIDS
-
getSIDForPrincipal
-
findMethod
-