public enum FileUtils extends Enum<FileUtils>
Utilities for interacting with files.
Modifier and Type | Method and Description |
---|---|
static boolean |
contentEquals(File f1,
File f2)
Return true if the content of both files is the same.
|
static boolean |
contentEquals(InputStream is1,
InputStream is2)
Return true if the content of both streams is the same.
|
static long |
copy(InputStream source,
OutputStream destination)
Copy the contents of the input stream to the output stream.
|
static String |
expandUserHome(String path)
Attempts to expand paths that may contain unix-style home shorthand.
|
static FileUtils |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static FileUtils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static FileUtils[] values()
for (FileUtils c : FileUtils.values()) System.out.println(c);
public static FileUtils valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static String expandUserHome(String path)
Attempts to expand paths that may contain unix-style home shorthand.
path
- The pathpublic static boolean contentEquals(File f1, File f2) throws IOException
Return true if the content of both files is the same.
f1
- first filef2
- second fileIOException
public static boolean contentEquals(InputStream is1, InputStream is2) throws IOException
Return true if the content of both streams is the same.
is1
- first streamis2
- second streamIOException
public static long copy(InputStream source, OutputStream destination) throws IOException
Copy the contents of the input stream to the output stream.
source
- input streamdestination
- output streamIOException
Copyright © 2016–2024. All rights reserved.