## org.das2.util.OsUtil

Utility methods for operating system functions.

## OsUtil( )

## closeQuietly

closeQuietly( java.io.InputStream input ) → void

Unconditionally close an `Reader`.

Equivalent to {@link Reader#close()}, except any exceptions will be ignored. This is typically used in finally blocks. From apache commons. http://grepcode.com/file_/repo1.maven.org/maven2/commons-io/commons-io/1.2/org/apache/commons/io/IOUtils.java/?v=source

### Parameters

input - the Reader to close, may be null or already closed

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## contentEquals

contentEquals( java.io.InputStream input1, java.io.InputStream input2 ) → boolean

Compare the contents of two Streams to determine if they are equal or not.

This method buffers the input internally using `BufferedInputStream` if they are not already buffered.

### Parameters

input1 - the first stream
input2 - the second stream

### Returns:

true if the content of the streams are equal or they both don't exist, false otherwise
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## contentEquals

contentEquals( java.io.File file1, java.io.File file2 ) → boolean

Compare the contents of two files to determine if they are equal or not.

This method checks to see if the two files are different lengths or if they point to the same file, before resorting to byte-by-byte comparison of the contents.

Code origin: Avalon

### Parameters

file1 - the first file
file2 - the second file

### Returns:

true if the content of the files are equal or they both don't exist, false otherwise
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getProcessId

getProcessId( String fallback ) → String

return the processID (pid), or the fallback if the pid cannot be found.

### Parameters

fallback - the string (null is okay) to return when the pid cannot be found.

### Returns:

the process id or the fallback provided by the caller.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## isWindows

isWindows( ) → boolean

return true if we are on a Windows machine. This platform will accept backslashes as forward-slash equivalent.

### Returns:

a boolean
[search for examples] [view on GitHub] [view on old javadoc] [view source]