public abstract class Utils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Utils.CommandResult |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
deletePath(File path) |
static void |
downloadFile(File file,
URL url) |
static Either<String> |
findCommand(Context context,
String path,
String name,
String contains) |
static List<File> |
findFiles(Context context,
File path,
List<String> extensions) |
static List<File> |
findNonEmptyDirs(File path,
String extension) |
static boolean |
isWindows() |
static List<String> |
listSources(File source,
Context context,
String extension) |
static String |
read(InputStream stream) |
static Either<String> |
readFile(File file) |
static Either<Document> |
readXml(InputStream stream) |
static Either<Utils.CommandResult> |
runCommand(Context context,
String command,
File path,
List<String> arguments) |
static Either<Utils.CommandResult> |
runCommand(Context context,
String command,
File path,
List<String> arguments,
Charset charset) |
static void |
saveFile(Context context,
File file,
String content) |
static boolean |
testCommand(Context context,
String command,
String contains) |
static boolean |
testCommand(Context context,
String command,
String contains,
List<String> arguments) |
static long |
unpackZip(Context context,
File path,
URL remoteUrl) |
public static String read(InputStream stream) throws IOException
IOExceptionpublic static void saveFile(Context context, File file, String content) throws IOException
IOExceptionpublic static long unpackZip(Context context, File path, URL remoteUrl) throws IOException
IOExceptionpublic static void downloadFile(File file, URL url) throws IOException
IOExceptionpublic static Either<Document> readXml(InputStream stream)
public static boolean isWindows()
public static Either<String> findCommand(Context context, String path, String name, String contains)
public static boolean testCommand(Context context, String command, String contains, List<String> arguments)
public static Either<Utils.CommandResult> runCommand(Context context, String command, File path, List<String> arguments)
public static Either<Utils.CommandResult> runCommand(Context context, String command, File path, List<String> arguments, Charset charset)
public static void deletePath(File path) throws IOException
IOExceptionCopyright © 2021. All rights reserved.