Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package base.template;
 
 import base.json.Json;

A resource associated with a template. Examples of resources include images, css files, javascript, HTML, email templates, etc...

public class Resource implements Comparable<Resource>, QueryResult {
	private String name;
	private byte[] data;
	private boolean binary;
	public Resource(String namebyte[] databoolean binary) {
		this. = name;
		this. = data;
		this. = binary;
	}
	public String getName() {
		return ;
	}
	public byte[] getData() {
		return ;
	}
	public boolean isBinary() {
		return ;
	}
	public int compareTo(Resource other) {
		return .compareTo(other.getName());
	}
	public String toString() {
		return toJson();
	}
	public String toJson() {
		return "{" +
				"\"name\":\"" + Json.escape() + "\"," +
				"\"data.length\":" + . + "," +
				"\"binary\":" +  + "" +
				"}";
	}
New to GrepCode? Check out our FAQ X