package com.uas.report.model;

import java.util.Date;

/**
 * 文件、文件夹等资源
 * 
 * @author sunyj
 * @since 2016年9月22日 下午7:59:14
 */
public class Resource {

	/**
	 * 资源版本
	 */
	private Integer version;

	/**
	 * 权限
	 */
	private Integer permissionMask;

	/**
	 * 资源创建时间
	 */
	private Date creationDate;

	/**
	 * 资源最后修改时间
	 */
	private Date updateDate;

	/**
	 * 资源名称（只用于显示，不用作标识）
	 */
	private String label;

	/**
	 * 描述信息
	 */
	private String description;

	/**
	 * 在资源库中的路径
	 */
	private String uri;

	/**
	 * 资源类型
	 */
	private String resourceType;

	public static final String FOLDER_RESOURCE_TYPE = "folder";

	/**
	 * jrxml文件类型
	 */
	public static final String JRXML_RESOURCE_TYPE = "jrxml";

	/**
	 * jrxml文件MIME Type
	 */
	public static final String JRXML_MIME_TYPE = "application/jrxml";

	/**
	 * 图片MIME Type
	 */
	public static final String IMAGE_MIME_TYPE = "image/*";

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public Integer getPermissionMask() {
		return permissionMask;
	}

	public void setPermissionMask(Integer permissionMask) {
		this.permissionMask = permissionMask;
	}

	public Date getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public Date getUpdateDate() {
		return updateDate;
	}

	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}

	public String getResourceType() {
		return resourceType;
	}

	public void setResourceType(String resourceType) {
		this.resourceType = resourceType;
	}

	/**
	 * @return 资源是否为文件夹
	 */
	public boolean isFolder() {
		return resourceType.equals(FOLDER_RESOURCE_TYPE);
	}

	@Override
	public String toString() {
		return "Resource [label=" + label + ", description=" + description + ", uri=" + uri + ", resourceType="
				+ resourceType + "]";
	}

}
