|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.entityfs.util.base.AbstractReadableFile
org.entityfs.util.UrlReadableFile
public class UrlReadableFile
This is a ReadableFile
that encapsulates an URL
.
Locking instances of this class returns a NoObjectDummyLock
.
Constructor Summary | |
---|---|
UrlReadableFile(URL url)
|
Method Summary | |
---|---|
String |
getName()
Get the name. |
long |
getSize()
Get the size of the file (in bytes). |
InputStream |
openForRead()
Open this file for reading. |
Methods inherited from class org.entityfs.util.base.AbstractReadableFile |
---|
getDataSize, getReadLock, isReadLockedByCurrentThread, lockForReading, openChannelForRead |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.entityfs.ReadableFile |
---|
getDataSize, openChannelForRead |
Methods inherited from interface org.entityfs.lock.ReadLockable |
---|
getReadLock, isReadLockedByCurrentThread, lockForReading |
Constructor Detail |
---|
public UrlReadableFile(URL url)
Method Detail |
---|
public String getName()
Named
/
.
getName
in interface Named
public InputStream openForRead() throws WrappedIOException
openForRead
in interface ReadableFile
InputStream
on the file. The stream must be closed by
the caller.
WrappedIOException
- If the underlying URL throws an IOException
.public long getSize()
ReadableFile
Note: Most, but not all, implementations know their sizes. If an implementation does not know its size beforehand, this method will be slow since it has to calculate the file size when it is called.
Implementation note: If the size of the backing file is not known,
the
StreamUtil.getSizeOfDataInStream(InputStream, int)
method can be used to calculate it.
getSize
in interface ReadableFile
ReadableFile.getDataSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |