Android Open Source - EvokeFramework Head Object






From Project

Back to project page EvokeFramework.

License

The source code is released under:

Apache License

If you think the Android project EvokeFramework 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 org.fs.net.evoke.data;
/*from   w  w w .jav  a  2s.com*/
/**
 * Created by Fatih on 29/01/15.
 * as org.fs.net.evoke.th.HeadObject
 */

import java.util.UUID;

/**
 * HEAD OBJECT that been created in the result of request 
 */

public final class HeadObject {

    private final long length;
    private final String contentType;
    private final String name;
    private final String etag;
    /**
     * Remote file, in destination. 
     */
    private final String remote;

    private HeadObject(final String name, final String etag, final String contentType, final long length, final String remote) {
        this.length = length;
        this.contentType = contentType;
        this.name = name;
        this.etag = etag;
        this.remote = remote;
    }

    public long getLength() {
        return length;
    }

    public String getContentType() {
        return contentType;
    }

    public String getName() {
        return name;
    }

    public String getEtag() {
        return etag;
    }

    public String getRemote() {
        return remote;
    }

    @Override
    public String toString() {
        return String.format("\nname:\t\t%s" +
                             "\ncontent-type:\t%s" +
                             "\ne-tag:\t\t%s" +
                             "\nremote:\t\t%s" +
                             "\nlength:\t\t%d", getName(), getContentType(), getEtag(), getRemote(), getLength());
    }

    /**
     * Builder. 
     */
    public static class Builder {
        long length;
        String name;
        String etag;
        String remote;
        String contentType;

        public Builder() {
            this.etag = UUID.randomUUID().toString();
        }

        public Builder length(long length) {
            this.length = length;
            return this;
        }

        public Builder name(String name) {
            this.name = name;
            return this;
        }

        public Builder remote(String remote) {
            this.remote = remote;
            return this;
        }

        public Builder contentType(String contentType) {
            this.contentType = contentType;
            return this;
        }

        public HeadObject build() {
            return new HeadObject(name, etag, contentType, length, remote);
        }
    }
}




Java Source Code List

org.fs.net.ApplicationTest.java
org.fs.net.MainActivity.java
org.fs.net.evoke.ApplicationTest.java
org.fs.net.evoke.DownloadManager.java
org.fs.net.evoke.core.AbstractObject.java
org.fs.net.evoke.data.Download.java
org.fs.net.evoke.data.Error.java
org.fs.net.evoke.data.HeadObject.java
org.fs.net.evoke.data.PartObject.java
org.fs.net.evoke.data.RequestObject.java
org.fs.net.evoke.database.DatabaseHelper.java
org.fs.net.evoke.listener.HeadCallback.java
org.fs.net.evoke.listener.PartCallback.java
org.fs.net.evoke.request.HeadRequest.java
org.fs.net.evoke.request.PartRequest.java
org.fs.net.evoke.th.AbstractRunnable.java
org.fs.net.evoke.util.JsonUtility.java
org.fs.net.evoke.util.LogUtil.java
org.fs.net.evoke.util.RequestUtility.java
org.fs.net.evoke.util.StringUtility.java
org.fs.net.evoke.util.Util.java