org.cloudfoundry.client.lib.archive
Class AbstractApplicationArchiveEntry
java.lang.Object
org.cloudfoundry.client.lib.archive.AbstractApplicationArchiveEntry
- All Implemented Interfaces:
- ApplicationArchive.Entry
public abstract class AbstractApplicationArchiveEntry
- extends Object
- implements ApplicationArchive.Entry
Base implementation of ApplicationArchive.Entry
that is reads the input stream to deduce the size and SHA
digest.
- Author:
- Phillip Webb
Method Summary |
byte[] |
getSha1Digest()
Returns a SHA1 digest over the contents of the entry or null if the entry
is a directory . |
long |
getSize()
Returns the size of entry or 0 if the entry is a directory . |
protected void |
setSha1Digest(byte[] sha1Digest)
Sets the SHA1 digest that should be returned. |
protected void |
setSize(long size)
Sets the size that should be returned. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UNDEFINED_SIZE
protected static final int UNDEFINED_SIZE
- See Also:
- Constant Field Values
AbstractApplicationArchiveEntry
public AbstractApplicationArchiveEntry()
setSize
protected void setSize(long size)
- Sets the size that should be returned. If this method is not called the size will be deduced by reading the
stream.
- Parameters:
size
- the size.
getSize
public long getSize()
- Description copied from interface:
ApplicationArchive.Entry
- Returns the size of entry or 0 if the entry is a
directory
.
- Specified by:
getSize
in interface ApplicationArchive.Entry
- Returns:
- the size
setSha1Digest
protected void setSha1Digest(byte[] sha1Digest)
- Sets the SHA1 digest that should be returned. If this method is not called the digest will be deduced by reading
the stream.
- Parameters:
sha1Digest
-
getSha1Digest
public byte[] getSha1Digest()
- Description copied from interface:
ApplicationArchive.Entry
- Returns a SHA1 digest over the
contents
of the entry or null if the entry
is a directory
.
- Specified by:
getSha1Digest
in interface ApplicationArchive.Entry
- Returns:
- the SHA1 digest
Copyright © 2013. All rights reserved.