PackagedPayloads¶
-
public class
PackagedPayloads
extends NamedPayloads¶ A packaged payloads represent a archive file typed payloads. Creation Date: 6/10/2006
Author: Twinsen Tsang
Constructors¶
PackagedPayloads¶
-
protected
PackagedPayloads
(String payloadsName, int initialState, PayloadsRepository owner)¶ Protected Explicit Constructor. This constructor is mainly used for creating a new payload proxy including the physical file and the proxy object. NOTE: The physical file is not created until it is necessary.
Parameters: - payloadsName – The name of the newly created payload.
- initialState – The initialState of the payloads, see
PayloadsState
for details. - owner – The owner of the payloads.
Throws: - Exception – Any kind of exceptions.
PackagedPayloads¶
-
protected
PackagedPayloads
(File payload, PayloadsRepository owner)¶ Protected Explicit Constructor.
Parameters: - payloads – The payloads directory.
- owner – The owner of this payload.
Throws: - IOException – If the payload is not directory.
Methods¶
getFilename¶
getFoldersPayload¶
-
public FoldersPayload
getFoldersPayload
(PayloadsRepository repo, int state, boolean isCreateFolder)¶ To create a FoldersPayload object for this payload, create the folder in the file system when needed
Parameters: - repo – owner repository of this folder payload
- state – state of the payload folder @see PayloadsState
- isCreateFolder – whether to create the specific folder in the file system
Throws: - IOException – if isCreateFolder is true and cannot create folder successfully
- PayloadException – if isCreateFolder is true and the folder already existing
Returns: FoldersPayload object
isPacked¶
-
public boolean
isPacked
()¶ Get whether the payload is packed in tar format
Returns: true for packed, false otherwise
save¶
-
public void
save
(InputStream content, boolean append)¶ Save the content from the input stream to this payloads. If the content stream is null, it save the file with empty content. This method is rarely used in this class because it’s semantics here is to copy the bytes from the inputstream to the package payload.
Parameters: - content – The input content stream.
- append – true if the new content is added to the existing content, false if the new content overwrite the existing.