public class FilePuller
extends java.lang.Object
implements java.util.concurrent.Delayed
Modifier and Type | Field and Description |
---|---|
(package private) int |
chunkSize |
private static long |
defaultDelay |
(package private) long |
delay |
private java.io.File |
file |
private long |
lastAccessTime |
private static org.apache.log4j.Logger |
log |
private compbio.util.FileWatcher |
watcher |
Modifier | Constructor and Description |
---|---|
private |
FilePuller(java.lang.String file) |
private |
FilePuller(java.lang.String file,
int size) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.util.concurrent.Delayed o) |
void |
disconnect() |
(package private) boolean |
disconnected() |
boolean |
equals(java.lang.Object obj) |
long |
getDelay(java.util.concurrent.TimeUnit unit) |
(package private) long |
getDelayValue(java.util.concurrent.TimeUnit unit) |
java.lang.String |
getFile() |
byte |
getProgress() |
int |
hashCode() |
boolean |
hasMoreData() |
private void |
init() |
void |
initPull() |
boolean |
isFileCreated() |
static FilePuller |
newFilePuller(java.lang.String file,
int chunkSize) |
static FilePuller |
newProgressPuller(java.lang.String file)
Progress Puller is designed to read 3 characters from the beginning of
the file, nothing more.
|
ChunkHolder |
pull(long position) |
(package private) static java.lang.String |
removeInvalidXMLCharacters(java.lang.String str)
This method ensures that the output String has only valid XML unicode
characters as specified by the XML 1.0 standard.
|
(package private) void |
setDelay(long delay,
java.util.concurrent.TimeUnit unit) |
java.lang.String |
toString() |
void |
waitForFile(long maxWaitSeconds) |
private static final org.apache.log4j.Logger log
private static long defaultDelay
private final java.io.File file
private long lastAccessTime
private compbio.util.FileWatcher watcher
final int chunkSize
long delay
private FilePuller(java.lang.String file, int size)
private FilePuller(java.lang.String file)
public static FilePuller newFilePuller(java.lang.String file, int chunkSize)
public static FilePuller newProgressPuller(java.lang.String file)
file
- public ChunkHolder pull(long position) throws java.io.IOException
java.io.IOException
static java.lang.String removeInvalidXMLCharacters(java.lang.String str)
The
- String whose non-valid characters we want to remove.public void initPull()
public java.lang.String getFile()
public boolean isFileCreated()
public void waitForFile(long maxWaitSeconds)
public boolean hasMoreData() throws java.io.IOException
java.io.IOException
private void init()
public int compareTo(java.util.concurrent.Delayed o)
compareTo
in interface java.lang.Comparable<java.util.concurrent.Delayed>
public long getDelay(java.util.concurrent.TimeUnit unit)
getDelay
in interface java.util.concurrent.Delayed
void setDelay(long delay, java.util.concurrent.TimeUnit unit)
long getDelayValue(java.util.concurrent.TimeUnit unit)
public void disconnect()
boolean disconnected()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public byte getProgress() throws java.io.IOException
java.io.IOException