package com.factcore.assets;

import com.factcore.vocab.COMMON;

/**
 * Fact:Core (c) 2014
 * Module: com.factcore.assets
 * User  : lee
 * Date  : 17/06/2014
 * Time  : 8:50 PM
 */
public class Asset {
    Object content = null;
    String mimeType = null;

    public Asset(Object content, String mimeType) {
        this.content=content;
        this.mimeType=mimeType;
    }

    public Asset(String content) {
        this.content=content;
        this.mimeType= COMMON.MIME_PLAIN;
    }

    public Object getContent() {
        return content;
    }

    public String getMimeType() {
        return mimeType;
    }

	public String getContentType() {
		if (getMimeType().startsWith(COMMON.MIME_TYPE)) {
			return getMimeType().substring(COMMON.MIME_TYPE.length());
		}
		return mimeType;
	}

	public String toString() {
        return content.toString();
    }

	public void setMimeType(String mimeType) {
		this.mimeType=mimeType;
	}
}



@@ -196,16 +196,41 @@
 Asset %7B%0A
+%09String identity = null;%0A
     Obje
@@ -277,16 +277,162 @@
  null;%0A%0A
+%09public Asset(String identity, Object content, String mimeType) %7B%0A%09%09this.identity=identity;%0A%09%09this.content=content;%0A%09%09this.mimeType=mimeType;%0A%09%7D%0A%0A
     publ

tweak common