Back to project page disconnected-content-explorer-android.
The source code is released under:
MIT License
If you think the Android project disconnected-content-explorer-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package mil.nga.dice.report; //from w w w . j av a2 s. c om import android.os.Parcel; import android.os.Parcelable; import android.util.Log; import java.io.File; import java.io.FileDescriptor; public class Report implements Parcelable { private File sourceFile; private File path; private String title; private String description; private String thumbnail; private String id; private String error; private Double lat; private Double lon; private boolean enabled = false; public Report() {} public String toString() { return this.title; } /** * Return the absolute path to the original file from which this report was created, e.g., a downloaded zip file. * @return */ public File getSourceFile() { return sourceFile; } public void setSourceFile(File x) { sourceFile = x; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getThumbnail() { return thumbnail; } public void setThumbnail(String thumbnail) { this.thumbnail = thumbnail; } public String getFileName() { return sourceFile.getName(); } public String getFileExtension() { String fileName = getFileName(); int lastDot = fileName.lastIndexOf("."); if (lastDot > -1 && lastDot < fileName.length() - 1) { return fileName.substring(lastDot + 1); } return null; } /** * Return the absolute path to the report content. * @return */ public File getPath() { return path; } public void setPath(File x) { path = x; } public String getId() { return this.id; } public void setId(String id) { this.id = id; } public String getError() { return error; } public void setError(String error) { this.error = error; } public Double getLat () { return lat; } public void setLat (Double lat) { this.lat = lat; } public Double getLon () { return lon; } public void setLon (Double lon) { this.lon = lon; } public Boolean isEnabled () { return enabled; } public void setEnabled (boolean enabled) { this.enabled = enabled; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel parcel, int flags) { if (description != null) parcel.writeString(description); else parcel.writeString(null); parcel.writeByte((byte) (enabled ? 1 : 0)); if (error != null) parcel.writeString(error); else parcel.writeString(null); if (id != null) parcel.writeString(id); else parcel.writeString(null); parcel.writeValue(lat); parcel.writeValue(lon); if (path != null) parcel.writeString(path.getAbsolutePath()); else parcel.writeString(null); if (sourceFile != null) parcel.writeString(sourceFile.getAbsolutePath()); else parcel.writeString(null); if (thumbnail != null) parcel.writeString(thumbnail); else parcel.writeValue(null); if (title != null) parcel.writeString(title); else parcel.writeValue(null); } public static final Parcelable.Creator<Report> CREATOR = new Creator<Report> () { @Override public Report createFromParcel(Parcel source) { Report report = new Report(); Object value; report.description = source.readString(); report.enabled = source.readByte() != 0; report.error = source.readString(); report.id = source.readString(); report.lat = (Double) source.readValue(null); report.lon = (Double) source.readValue(null); value = source.readString(); if (value != null && !value.toString().isEmpty()) { report.path = new File(value.toString()); } value = source.readString(); if (value != null && !value.toString().isEmpty()) { report.sourceFile = new File(value.toString()); } report.thumbnail = source.readString(); report.title = source.readString(); return report; } public Report[] newArray(int size) { return new Report[size]; } }; }