Package org.jclouds.filesystem.util
Class Utils
- java.lang.Object
-
- org.jclouds.filesystem.util.Utils
-
public class Utils extends Object
Utilities for the filesystem blobstore.
-
-
Field Summary
Fields Modifier and Type Field Description static StringWINDOWS_EVERYONE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddelete(File file)static voiddeleteRecursively(File file)Delete a file or a directory recursively.static StringgetWindowsEveryonePrincipalName()static booleanisMacOSX()Determine if Java is running on a Mac OSstatic booleanisPrivate(Path path)static booleanisWindows()Determine if Java is running on a windows OSstatic voidsetPrivate(Path path)static voidsetPublic(Path path)
-
-
-
Field Detail
-
WINDOWS_EVERYONE
public static final String WINDOWS_EVERYONE
-
-
Method Detail
-
isMacOSX
public static boolean isMacOSX()
Determine if Java is running on a Mac OS
-
isWindows
public static boolean isWindows()
Determine if Java is running on a windows OS
-
deleteRecursively
public static void deleteRecursively(File file) throws IOException
Delete a file or a directory recursively.- Throws:
IOException
-
delete
public static void delete(File file) throws IOException
- Throws:
IOException
-
getWindowsEveryonePrincipalName
public static final String getWindowsEveryonePrincipalName()
- Returns:
- Localized name for the "Everyone" Windows principal.
-
isPrivate
public static boolean isPrivate(Path path) throws IOException
- Parameters:
path- The path to a Windows file or directory.- Returns:
- true if path has permissions set to Everyone on windows. The exact permissions are not checked.
- Throws:
IOException
-
setPrivate
public static void setPrivate(Path path) throws IOException
- Parameters:
path- Remove "Everyone" from this path's Windows ACL permissions.- Throws:
IOException
-
setPublic
public static void setPublic(Path path) throws IOException
- Parameters:
path- Add "Everyone" with read enabled to this path's Windows ACL permissions.- Throws:
IOException
-
-