Android Open Source - couchdbsyncer-android Attachment






From Project

Back to project page couchdbsyncer-android.

License

The source code is released under:

Apache License

If you think the Android project couchdbsyncer-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.

Java Source Code

package au.com.team2moro.couchdbsyncer;
/* ww w. j a v  a2  s.  c  o  m*/
public class Attachment {

  private byte[] content;
  private String filename, contentType, docId;
  private boolean stale;
  private long attachmentId, documentId;
  private long length, revision;
  
  public Attachment(String filename) {
    this.filename = filename;
    this.attachmentId = -1;
    this.documentId = -1;
  }

  public String toString() {
    return filename;
  }
  
  // override equals (used in Set functionality in DatabaseStore)
  public boolean equals(Object other) {
    if(!(other instanceof Attachment)) return false;
    return this.filename.equals(((Attachment)other).filename);
  }
  
  public int hashCode() {
    return this.filename.hashCode();
  }
  
  public long getAttachmentId() {
    return attachmentId;
  }

  public void setAttachmentId(long attachmentId) {
    this.attachmentId = attachmentId;
  }

  public byte[] getContent() {
    return content;
  }

  public void setContent(byte[] content) {
    this.content = content;
  }

  public long getLength() {
    return length;
  }

  public void setLength(long length) {
    this.length = length;
  }

  public String getDocId() {
    return docId;
  }

  public void setDocId(String docId) {
    this.docId = docId;
  }

  public String getFilename() {
    return filename;
  }

  public long getRevision() {
    return revision;
  }

  public void setRevision(long revision) {
    this.revision = revision;
  }

  public String getContentType() {
    return contentType;
  }

  public void setContentType(String contentType) {
    this.contentType = contentType;
  }

  public long getDocumentId() {
    return documentId;
  }

  public void setDocumentId(long documentId) {
    this.documentId = documentId;
  }

  public boolean isStale() {
    return stale;
  }

  public void setStale(boolean stale) {
    this.stale = stale;
  }
  
  public boolean isImage() {
    return contentType.startsWith("image/");
  }
  
}




Java Source Code List

au.com.team2moro.couchdbsyncer.Attachment.java
au.com.team2moro.couchdbsyncer.BulkFetcher.java
au.com.team2moro.couchdbsyncer.ConnectionSettingsTrustAll.java
au.com.team2moro.couchdbsyncer.ConnectionSettings.java
au.com.team2moro.couchdbsyncer.DatabaseStore.java
au.com.team2moro.couchdbsyncer.Database.java
au.com.team2moro.couchdbsyncer.Document.java
au.com.team2moro.couchdbsyncer.DownloadPolicy.java
au.com.team2moro.couchdbsyncer.Fetcher.java
au.com.team2moro.couchdbsyncer.SequencedDocument.java
au.com.team2moro.couchdbsyncer.SyncerService.java
au.com.team2moro.couchdbsyncer.Syncer.java
au.com.team2moro.couchdbsyncer.package-info.java