public class Utils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
WINDOWS_EVERYONE |
Modifier and Type | Method and Description |
---|---|
static void |
delete(File file) |
static void |
deleteRecursively(File file)
Delete a file or a directory recursively.
|
static String |
getWindowsEveryonePrincipalName() |
static boolean |
isMacOSX()
Determine if Java is running on a Mac OS
|
static boolean |
isPrivate(java.nio.file.Path path) |
static boolean |
isWindows()
Determine if Java is running on a windows OS
|
static void |
setPrivate(java.nio.file.Path path) |
static void |
setPublic(java.nio.file.Path path) |
public static final String WINDOWS_EVERYONE
public static boolean isMacOSX()
public static boolean isWindows()
public static void deleteRecursively(File file) throws IOException
IOException
public static void delete(File file) throws IOException
IOException
public static final String getWindowsEveryonePrincipalName()
public static boolean isPrivate(java.nio.file.Path path) throws IOException
path
- The path to a Windows file or directory.IOException
public static void setPrivate(java.nio.file.Path path) throws IOException
path
- Remove "Everyone" from this path's Windows ACL permissions.IOException
public static void setPublic(java.nio.file.Path path) throws IOException
path
- Add "Everyone" with read enabled to this path's Windows ACL permissions.IOException
Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.