Top Description Fields Constructors Methods
com.oracle.bmc.util.internal

public final Enum FileUtils

extends Enum<FileUtils>
Class Inheritance
Imports
java.io.BufferedInputStream, .File, .FileInputStream, .IOException, .InputStream, .OutputStream

Utilities for interacting with files.

Field Summary

Modifier and TypeField and Description
pack-priv static final boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

true if the same
contentEquals
(File
first file
f1
,
File
second file
f2
)

Return true if the content of both files is the same.

public static boolean

Returns:

true if the same
contentEquals
(InputStream
first stream
is1
,
InputStream
second stream
is2
)

Return true if the content of both streams is the same.

public static long

Returns:

number of bytes read
copy
(InputStream
input stream
source
,
OutputStream
output stream
destination
)

Copy the contents of the input stream to the output stream.

pack-priv static String
correctPath(boolean isWindows, String path)

public static String

Returns:

The path after expanding the home directory, if needed.
expandUserHome
(final String
The path
path
)

Attempts to expand paths that may contain unix-style home shorthand.

public static FileUtils
public static FileUtils[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

IS_OS_WINDOWSback to summary
pack-priv static final boolean IS_OS_WINDOWS

Constructor Detail

FileUtilsback to summary
private FileUtils()

Method Detail

contentEqualsback to summary
public static boolean contentEquals(File f1, File f2) throws IOException

Return true if the content of both files is the same.

Parameters
f1:File

first file

f2:File

second file

Returns:boolean

true if the same

contentEqualsback to summary
public static boolean contentEquals(InputStream is1, InputStream is2) throws IOException

Return true if the content of both streams is the same.

Parameters
is1:InputStream

first stream

is2:InputStream

second stream

Returns:boolean

true if the same

copyback to summary
public static long copy(InputStream source, OutputStream destination) throws IOException

Copy the contents of the input stream to the output stream.

Parameters
source:InputStream

input stream

destination:OutputStream

output stream

Returns:long

number of bytes read

correctPathback to summary
pack-priv static String correctPath(boolean isWindows, String path)
expandUserHomeback to summary
public static String expandUserHome(final String path)

Attempts to expand paths that may contain unix-style home shorthand.

Parameters
path:String

The path

Returns:String

The path after expanding the home directory, if needed.

valueOfback to summary
public static FileUtils valueOf(String name)
valuesback to summary
public static FileUtils[] values()