org.nees.data.test
Class FileTestUtility

java.lang.Object
  extended byorg.nees.data.test.FileTestUtility

public class FileTestUtility
extends java.lang.Object

Author:
USER

Field Summary
static java.lang.String DOWNLOAD_PREFIX
           
static java.lang.String DOWNLOAD_SUFFIX
           
static java.lang.String UPLOAD_PREFIX
           
static java.lang.String UPLOAD_SUFFIX
           
 
Constructor Summary
FileTestUtility(java.lang.String scratchDirectory, int blockSize)
          Creates a new instance of FileTestUtility
 
Method Summary
 java.io.File createDownloadFile()
          To download, we need a local file.
 java.io.File[] createDownloadFiles(int count)
           
 java.io.File createUploadFile()
           
 java.io.File[] createUploadFiles(int count)
           
 boolean fileCompare(java.io.File[] originalList, java.io.File toTest)
          This will test a list of files that have been concatenated together.
 boolean fileCompare(java.io.File original, java.io.File toTest)
           
 boolean fileCompare(java.io.File original, java.io.File toTest, int appendCount)
          This takes two files that are the same or one consists of copies of the first appended together appendCount times.
protected  java.io.File getScratchDirectory()
           
 java.net.URI resolveURI(java.net.URI base, java.net.URI resolvee)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPLOAD_PREFIX

public static java.lang.String UPLOAD_PREFIX

UPLOAD_SUFFIX

public static java.lang.String UPLOAD_SUFFIX

DOWNLOAD_PREFIX

public static java.lang.String DOWNLOAD_PREFIX

DOWNLOAD_SUFFIX

public static java.lang.String DOWNLOAD_SUFFIX
Constructor Detail

FileTestUtility

public FileTestUtility(java.lang.String scratchDirectory,
                       int blockSize)
Creates a new instance of FileTestUtility

Method Detail

resolveURI

public java.net.URI resolveURI(java.net.URI base,
                               java.net.URI resolvee)
                        throws java.lang.Exception
Throws:
java.lang.Exception

getScratchDirectory

protected java.io.File getScratchDirectory()
                                    throws java.lang.Exception
Throws:
java.lang.Exception

createDownloadFile

public java.io.File createDownloadFile()
                                throws java.lang.Exception
To download, we need a local file. This creates one in the right place.

Throws:
java.lang.Exception

createDownloadFiles

public java.io.File[] createDownloadFiles(int count)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

createUploadFile

public java.io.File createUploadFile()
                              throws java.lang.Exception
Throws:
java.lang.Exception

createUploadFiles

public java.io.File[] createUploadFiles(int count)
                                 throws java.lang.Exception
Throws:
java.lang.Exception

fileCompare

public boolean fileCompare(java.io.File original,
                           java.io.File toTest,
                           int appendCount)
                    throws java.lang.Exception
This takes two files that are the same or one consists of copies of the first appended together appendCount times.

Throws:
java.lang.Exception

fileCompare

public boolean fileCompare(java.io.File original,
                           java.io.File toTest)
                    throws java.lang.Exception
Throws:
java.lang.Exception

fileCompare

public boolean fileCompare(java.io.File[] originalList,
                           java.io.File toTest)
                    throws java.lang.Exception
This will test a list of files that have been concatenated together. This allows to see if the files are done in the correct order.

Throws:
java.lang.Exception