Public feed #894458

bd

public text v1 · immutable
Raw Edit
·published 2008-02-06 23:33 UTC
rendered paste body
package fileserver;

import hxServlet.Servlet ;
import hxServlet.Resource ;

class FileServer extends Servlet {

	public static function main() {}

	public function new() {
		super();
	}

	public function mp() {
		var brand:String;
		var type:String;
		var uuid;
		var fileName:String;

		var res = getResource() ;
		if (res == null)
			return ;

		for (r in res) {
			if (r.isFile) {
				uuid = r.uuid;
				fileName = r.fileName;
			} else {
				if (r.getResourceKey() == "brand")
					brand = r.getResourceValue();
				if (r.getResourceKey() == "type")
					type = r.getResourceValue();
			}
		}

		var convert = ["convert", "-sample","80x40",rawFile,newFile];
		var rawFile = "res/"+uuid;
		var newFile = "html/assets/"+brand+"/"+type+"/large/"+fileName+".jpg";
		neko.io.Process("convert",convert);
	}
}