public class MissionPackageManifest
extends java.lang.Object
implements android.os.Parcelable
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<MissionPackageManifest> |
CREATOR |
static long |
MAP_ITEM_ESTIMATED_SIZE |
static long |
POINT_ESTIMATED_SIZE |
static long |
ROUTE_POINT_ESTIMATED_SIZE |
Constructor and Description |
---|
MissionPackageManifest()
ctor
|
MissionPackageManifest(MissionPackageManifest copy)
copy ctor
|
MissionPackageManifest(java.lang.String name,
java.lang.String dir)
ctor
|
MissionPackageManifest(java.lang.String name,
java.lang.String uid,
java.lang.String dir) |
Modifier and Type | Method and Description |
---|---|
boolean |
addContent(MissionPackageContent content) |
boolean |
addFile(java.io.File file,
java.lang.String attachedUID)
Add specified file to the data package and optionally attach to a map
item
|
boolean |
addFile(java.io.File file,
java.lang.String contentType,
java.lang.String attachedUID)
Add specified file to the data package and optionally attach to a map
item
|
boolean |
addMapItem(java.lang.String uid)
Add Map Item to the Mission Package
|
boolean |
addMapItems(java.lang.String... mapItemUIDArray)
Add Map Items to the Mission Package
|
void |
clear()
Clear Map Items and Files
|
int |
describeContents() |
boolean |
equals(MissionPackageManifest rhsc) |
boolean |
equals(java.lang.Object o) |
static long |
estimateMapItemSize(MapItem item)
Estimate the size of a map item CoT message
|
static MissionPackageManifest |
fromXml(java.lang.String xml,
java.lang.String filePath) |
static MissionPackageManifest |
fromXml(java.lang.String xml,
java.lang.String filePath,
boolean calcSizes)
Parse the specified Mission Package manifest XML to a manifest object
|
MissionPackageConfiguration |
getConfiguration() |
MissionPackageContents |
getContents() |
int |
getCount() |
int |
getFileCount()
Get number of files in the Mission Package
|
java.util.List<MissionPackageContent> |
getFiles()
Get list of file paths in the Mission Package
|
long |
getFilesSize()
Get total uncompressed size of files in the Mission Package
|
java.util.Collection<java.lang.String> |
getHashtags() |
java.lang.String |
getLastSavedPath()
Get last path the Mission Package was saved to
|
java.util.List<java.io.File> |
getLocalFiles()
Same as above but the actual list of files is returned, not metadata
|
long |
getMapDataSize()
Get uncompressed (or otherwise estimated) size of all Map Items
in the Mission Package
|
int |
getMapItemCount()
Get number of Map Items in the Mission Package
|
java.util.List<MissionPackageContent> |
getMapItems()
Get list of UIDs for Map Items in the Mission Package
|
java.lang.String |
getName()
Get user provided name for the package
|
java.lang.String |
getPath()
Get path (including directory and filename)
|
java.lang.String |
getRemarks()
Get user provided remarks for the package
|
long |
getTotalSize()
Get total estimated uncompressed size of all contents in the Mission Package
|
java.lang.String |
getUID()
Get Unique ID (UUID)
|
int |
getVersion()
Get content listing version
|
boolean |
hasFile(MissionPackageContent content)
Check if the specified file is in the Mission Package
|
boolean |
hasFiles()
True if Mission Package has files
|
int |
hashCode() |
boolean |
hasMapItems()
True if Mission Package has Map Items
|
boolean |
isEmpty()
Empty if no Map Items and no Files
|
boolean |
isValid() |
boolean |
pathExists() |
boolean |
removeContent(MissionPackageContent content) |
boolean |
removeFile(MissionPackageContent content)
Remove file from the Mission Package
|
boolean |
removeMapItem(MissionPackageListMapItem item)
Remove Map Item from the Mission Package
|
void |
setName(java.lang.String name)
Set user provided name for the package
|
void |
setName(java.lang.String name,
java.lang.String dir)
Set name and update path
|
void |
setPath(java.lang.String path)
Set path (including directory and filename)
|
void |
setRemarks(java.lang.String remarks)
Set user provided remarks for the package
|
java.lang.String |
toString() |
java.lang.String |
toXml(boolean localManifest)
Serialize the content listing out to String
|
void |
writeToParcel(android.os.Parcel parcel,
int flags) |
public static final long MAP_ITEM_ESTIMATED_SIZE
public static final long POINT_ESTIMATED_SIZE
public static final long ROUTE_POINT_ESTIMATED_SIZE
public static final android.os.Parcelable.Creator<MissionPackageManifest> CREATOR
public MissionPackageManifest()
public MissionPackageManifest(java.lang.String name, java.lang.String dir)
name
- Name of Mission Packagedir
- Directory to store Mission Packagepublic MissionPackageManifest(java.lang.String name, java.lang.String uid, java.lang.String dir)
public MissionPackageManifest(MissionPackageManifest copy)
copy
- public boolean isValid()
public MissionPackageContents getContents()
public MissionPackageConfiguration getConfiguration()
public boolean isEmpty()
public void clear()
public java.lang.String getUID()
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getRemarks()
public void setRemarks(java.lang.String remarks)
public void setName(java.lang.String name, java.lang.String dir)
name
- dir
- public java.lang.String getPath()
public boolean pathExists()
public void setPath(java.lang.String path)
public boolean hasMapItems()
public boolean hasFiles()
public int getFileCount()
public java.util.List<MissionPackageContent> getFiles()
public java.util.List<java.io.File> getLocalFiles()
public java.util.List<MissionPackageContent> getMapItems()
public int getCount()
public boolean addFile(java.io.File file, java.lang.String contentType, java.lang.String attachedUID)
file
- File to addcontentType
- Content type of the file (null if N/A)attachedUID
- Map item UID (null if not an attachment)public boolean addFile(java.io.File file, java.lang.String attachedUID)
file
- File to addattachedUID
- Map item UID (null if not an attachment)public boolean addContent(MissionPackageContent content)
public boolean addMapItems(java.lang.String... mapItemUIDArray)
mapItemUIDArray
- public boolean addMapItem(java.lang.String uid)
uid
- public boolean removeContent(MissionPackageContent content)
public boolean removeFile(MissionPackageContent content)
content
- public boolean hasFile(MissionPackageContent content)
content
- public boolean removeMapItem(MissionPackageListMapItem item)
item
- public int getMapItemCount()
public long getFilesSize()
public long getMapDataSize()
public long getTotalSize()
public static long estimateMapItemSize(MapItem item)
item
- Map itempublic java.lang.String toString()
toString
in class java.lang.Object
public int describeContents()
describeContents
in interface android.os.Parcelable
public void writeToParcel(android.os.Parcel parcel, int flags)
writeToParcel
in interface android.os.Parcelable
public java.lang.String toXml(boolean localManifest)
localManifest
- true for local manifest (extra data included), false for package
manifestpublic static MissionPackageManifest fromXml(java.lang.String xml, java.lang.String filePath, boolean calcSizes)
xml
- Manifest XMLfilePath
- Local file path of the Mission Package ZIPcalcSizes
- True to calculate the compressed and uncompressed
size of all content inside the manifestpublic static MissionPackageManifest fromXml(java.lang.String xml, java.lang.String filePath)
public java.lang.String getLastSavedPath()
public java.util.Collection<java.lang.String> getHashtags()
public int getVersion()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public boolean equals(MissionPackageManifest rhsc)