Package com.oracle.bmc.util.internal
Enum FileUtils
- java.lang.Object
- 
- java.lang.Enum<FileUtils>
- 
- com.oracle.bmc.util.internal.FileUtils
 
 
- 
- All Implemented Interfaces:
- Serializable,- Comparable<FileUtils>
 
 public enum FileUtils extends Enum<FileUtils> Utilities for interacting with files.
- 
- 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontentEquals(File f1, File f2)Return true if the content of both files is the same.static booleancontentEquals(InputStream is1, InputStream is2)Return true if the content of both streams is the same.static longcopy(InputStream source, OutputStream destination)Copy the contents of the input stream to the output stream.static StringexpandUserHome(String path)Attempts to expand paths that may contain unix-style home shorthand.static FileUtilsvalueOf(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.
 
- 
- 
- 
Method Detail- 
valuespublic static FileUtils[] values() Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FileUtils c : FileUtils.values()) System.out.println(c); - Returns:
- an array containing the constants of this enum type, in the order they are declared
 
 - 
valueOfpublic static FileUtils valueOf(String name) Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
- name- the name of the enum constant to be returned.
- Returns:
- the enum constant with the specified name
- Throws:
- IllegalArgumentException- if this enum type has no constant with the specified name
- NullPointerException- if the argument is null
 
 - 
expandUserHomepublic static String expandUserHome(String path) Attempts to expand paths that may contain unix-style home shorthand.- Parameters:
- path- The path
- Returns:
- The path after expanding the home directory, if needed.
 
 - 
contentEqualspublic static boolean contentEquals(File f1, File f2) throws IOException Return true if the content of both files is the same.- Parameters:
- f1- first file
- f2- second file
- Returns:
- true if the same
- Throws:
- IOException
 
 - 
contentEqualspublic static boolean contentEquals(InputStream is1, InputStream is2) throws IOException Return true if the content of both streams is the same.- Parameters:
- is1- first stream
- is2- second stream
- Returns:
- true if the same
- Throws:
- IOException
 
 - 
copypublic static long copy(InputStream source, OutputStream destination) throws IOException Copy the contents of the input stream to the output stream.- Parameters:
- source- input stream
- destination- output stream
- Returns:
- number of bytes read
- Throws:
- IOException
 
 
- 
 
-