Package org.jbundle.jbackup.source
Class BaseSource
- java.lang.Object
-
- org.jbundle.jbackup.source.BaseSource
-
- All Implemented Interfaces:
Iterator<SourceFile>,JBackupConstants,SourceFileList,org.jbundle.util.apprunner.PropertyOwner
- Direct Known Subclasses:
FilesystemSource,ZipSource
public class BaseSource extends Object implements SourceFileList, org.jbundle.util.apprunner.PropertyOwner, JBackupConstants
Directory scanner. This class is a utility for scanning through a directory tree.- Version:
- Author:
- Administrator
-
-
Field Summary
Fields Modifier and Type Field Description static chargchSeparatorprotected Datem_dateLastBackupprotected FilenameFilterm_Filterprotected SourceFilem_nextPend-
Fields inherited from interface org.jbundle.jbackup.JBackupConstants
BACKUP_INCREMENTAL_PARAM, BACKUPDATE_PARAM, BASE_URL_PARAM, BLANK, CALC_FILE_LENGTH_PARAM, DEBUG, DEFAULT_PROPERTY_FILENAME, DEFAULT_ROOT_DIR, DEST_ROOT_PATHNAME_PARAM, DESTINATION_PARAM, FALSE, FILTER_PARAM, FTP_HOST, FTP_PORT, HTTP, LOG_FILENAME_PARAM, MAX_LEVELS, MAX_SIZE_PARAM, PASSWORD, PROPERTY_FILENAME_PARAM, PROPERTY_QUIET_PARAM, ROOT_DIR, ROOT_PACKAGE, SOURCE_PARAM, SOURCE_ROOT_PATHNAME_PARAM, TRUE, USER_NAME, ZIPIN_FILENAME_PARAM, ZIPOUT_FILENAME_PARAM, ZIPOUT_PATHNAME_PARAM
-
-
Constructor Summary
Constructors Constructor Description BaseSource()BaseSource(Properties properties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfinishTransfer(Properties properties)SourceFilegetPend()Returns the next element in the interation.org.jbundle.util.apprunner.PropertyViewgetPropertyView(Properties properties)booleanhasNext()Returns true if the iteration has more elements.voidinit(Properties properties)voidinitTransfer(Properties properties)booleanisPend()Returns the next element in the interation.SourceFilenext()Returns the next element in the iteration.voidremove()Removes from the underlying collection the last element returned by the iterator (optional operation).voidsetProperties(Properties p1)booleanskipFile(File inFile)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
gchSeparator
public static char gchSeparator
-
m_dateLastBackup
protected Date m_dateLastBackup
-
m_Filter
protected FilenameFilter m_Filter
-
m_nextPend
protected SourceFile m_nextPend
-
-
Constructor Detail
-
BaseSource
public BaseSource()
-
BaseSource
public BaseSource(Properties properties)
-
-
Method Detail
-
init
public void init(Properties properties)
-
initTransfer
public void initTransfer(Properties properties)
- Specified by:
initTransferin interfaceSourceFileList
-
finishTransfer
public void finishTransfer(Properties properties)
- Specified by:
finishTransferin interfaceSourceFileList
-
getPropertyView
public org.jbundle.util.apprunner.PropertyView getPropertyView(Properties properties)
- Specified by:
getPropertyViewin interfaceorg.jbundle.util.apprunner.PropertyOwner
-
setProperties
public void setProperties(Properties p1)
- Specified by:
setPropertiesin interfaceorg.jbundle.util.apprunner.PropertyOwner
-
hasNext
public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)- Specified by:
hasNextin interfaceIterator<SourceFile>- Returns:
- true if the iterator has more elements.
-
isPend
public boolean isPend()
Returns the next element in the interation. (Returns a SourceFileObject).- Returns:
- the next element in the iteration.
- Throws:
NoSuchElementException- iteration has no more elements.
-
getPend
public SourceFile getPend()
Returns the next element in the interation. (Returns a SourceFileObject).public Object next() { if (this.isPend()) return this.getPend(); return null; }- Returns:
- the next element in the iteration.
- Throws:
NoSuchElementException- iteration has no more elements.
-
next
public SourceFile next()
Returns the next element in the iteration. (Returns a SourceFileObject).- Specified by:
nextin interfaceIterator<SourceFile>
-
remove
public void remove()
Removes from the underlying collection the last element returned by the iterator (optional operation). This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.- Specified by:
removein interfaceIterator<SourceFile>- Throws:
UnsupportedOperationException- if the remove operation is not supported by this Iterator.IllegalStateException- if the next method has not yet been called, or the remove method has already been called after the last call to the next method.
-
skipFile
public boolean skipFile(File inFile)
-
-