biz.neustar.wpm.api
Interface DataFile


public interface DataFile

An object that contains a handle to an uploaded file and supporting operations


Method Summary
 java.lang.String base64()
          Returns the base64 encoding of this file.
 void close()
          close the corresponding file and related resources
 boolean isOpen()
          determine if the underlying file is currently open
 java.lang.String md5()
          Returns the MD5 of this file in hex string form.
 java.lang.Object md5(boolean binary)
          Returns the MD5 of this file in hex string form or binary form.
 java.lang.String readContents()
          read the entire contents of a file If a reader has not been instantiated then one will be and closed upon completion
 java.lang.String readLine()
          read a line using the current reader If a reader has not been instantiated then one will be
 

Method Detail

readLine

java.lang.String readLine()
                          throws java.io.IOException
read a line using the current reader If a reader has not been instantiated then one will be

Returns:
String containing the content that was read
Throws:
java.io.IOException - thrown when there was a problem reading the file

readContents

java.lang.String readContents()
                              throws java.io.IOException
read the entire contents of a file If a reader has not been instantiated then one will be and closed upon completion

Returns:
String containing the content that was read
Throws:
java.io.IOException - thrown when there was a problem reading the file

isOpen

boolean isOpen()
determine if the underlying file is currently open

Returns:
boolean true if file is open, false if not

close

void close()
           throws java.io.IOException
close the corresponding file and related resources

Throws:
java.io.IOException - thrown when there was a problem closing the file

md5

java.lang.String md5()
Returns the MD5 of this file in hex string form.

Returns:
the hex string MD5
See Also:
Utils.md5(Object)

md5

java.lang.Object md5(boolean binary)
Returns the MD5 of this file in hex string form or binary form.

Parameters:
binary - whether to return a binary or hex string MD5
Returns:
the hex string MD5 or the Bytes
See Also:
Utils.md5(Object, boolean)

base64

java.lang.String base64()
Returns the base64 encoding of this file.

Returns:
base64 encoded string
See Also:
Utils.base64(Object)

Copyright © 2014 Neustar, Inc. All Rights Reserved.