EAC Toolkit 3.2.1

com.endeca.soleng.eac.toolkit.utility
Class FileUtility

java.lang.Object
  extended by com.endeca.soleng.eac.toolkit.base.EacElement
      extended by com.endeca.soleng.eac.toolkit.utility.Utility
          extended by com.endeca.soleng.eac.toolkit.utility.FileUtility

public class FileUtility
extends Utility

FileUtility extends the Utility object, exposing methods that wrap the utility web service's listDirectoryContents call. Included in this object are implementations of common methods used to test the existence of files and directories.

Author:
sshusteff

Field Summary
 
Fields inherited from class com.endeca.soleng.eac.toolkit.utility.Utility
EAC_MAX_TOKEN_LENGTH, ENDECA_CONF, IS_WINDOWS, WINDOWS_MAX_PATH_LENGTH
 
Fields inherited from class com.endeca.soleng.eac.toolkit.base.EacElement
appName, dataPrefix, eacHost, eacPort, elementId, lockManager, logDir, sslEnabled, workingDir
 
Constructor Summary
FileUtility()
           
FileUtility(java.lang.String appName, java.lang.String eacHost, int eacPort, boolean sslEnabled)
          Default (inherited) constructor.
 
Method Summary
 boolean dirContainsFiles(java.lang.String dir, java.lang.String hostId)
          Tests whether there are any files in a directory.
 boolean dirExists(java.lang.String dir, java.lang.String hostId)
          Tests whether a specified directory exists.
 boolean fileExists(java.lang.String dir, java.lang.String file, java.lang.String hostId)
          Tests whether a specified file exists in a directory.
 
Methods inherited from class com.endeca.soleng.eac.toolkit.utility.Utility
buildEacStub, getDirContents, getMaxMissedStatusChecksAllowed, getMaxWaitTimeSeconds, getMinWaitTimeSeconds, getNonNullPositiveLongValueOrDefault, getNumMissedStatusChecks, getSlowPollingIntervalMs, getStandardPollingIntervalMs, getStatus, incrementMissedStatusQueries, initializeEacStub, isActive, isFailed, maximumAllowedTokenLength, run, runInParallel, setElementId, setMaxMissedStatusQueriesAllowed, setMaxWaitSeconds, setMinWaitSeconds, setNumMissedStatusChecks, setPollingIntervalMs, setSlowPollingIntervalMs, start, stop, waitForFinished
 
Methods inherited from class com.endeca.soleng.eac.toolkit.base.EacElement
getAppName, getDataPrefix, getEacHost, getEacPort, getElementId, getLockManager, getLogDir, getWorkingDir, isSslEnabled, setAppName, setDataPrefix, setEacHost, setEacPort, setLockManager, setLogDir, setSslEnabled, setWorkingDir
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtility

public FileUtility(java.lang.String appName,
                   java.lang.String eacHost,
                   int eacPort,
                   boolean sslEnabled)
            throws AppConfigurationException
Default (inherited) constructor.

Throws:
AppConfigurationException - If the application name or EAC host is null.

FileUtility

public FileUtility()
Method Detail

fileExists

public boolean fileExists(java.lang.String dir,
                          java.lang.String file,
                          java.lang.String hostId)
                   throws EacCommunicationException
Tests whether a specified file exists in a directory.

Parameters:
dir - Directory in which to search.
file - File name to search for.
hostId - ID of host on which to search.
Returns:
Returns true if the file exists, false if it doesn't.
Throws:
EacCommunicationException

dirExists

public boolean dirExists(java.lang.String dir,
                         java.lang.String hostId)
                  throws EacCommunicationException
Tests whether a specified directory exists. Returns true if a file or directory exists at the specified path.

Parameters:
dir - Directory to test.
hostId - ID of host on which to search.
Returns:
Returns true if the directory exists, false if it doesn't.
Throws:
EacCommunicationException

dirContainsFiles

public boolean dirContainsFiles(java.lang.String dir,
                                java.lang.String hostId)
                         throws EacCommunicationException
Tests whether there are any files in a directory.

Parameters:
dir - Directory in which to search.
hostId - ID of host on which to search.
Returns:
Returns true if any file exists in the directory, false if it's empty.
Throws:
EacCommunicationException

EAC Toolkit 3.2.1

Copyright © 2011 Endeca Technologies, Inc. All Rights Reserved.
@VERSION
PRODUCT: EAC Toolkit (eacToolkit)
VERSION: 3.2.1
BUILD:   NONE
ARCH_OS: n/a
DATE:    2011-11-10T16:21:05-0500