65 lines
1.7 KiB
Plaintext
Executable File
65 lines
1.7 KiB
Plaintext
Executable File
/*
|
|
*
|
|
*/
|
|
package com.fp.bpmlib.report;
|
|
|
|
import com.fp.dto.Response;
|
|
import com.fp.dto.query.QueryRequest;
|
|
import com.fp.dto.rules.QueryRule;
|
|
|
|
// TODO: Auto-generated Javadoc
|
|
/**
|
|
* Clase que devuelve en bytes un archivo.
|
|
*
|
|
* @author gfiallos
|
|
*/
|
|
public abstract class DownloadFileQuery extends QueryRule {
|
|
|
|
/** serialVersionUID. */
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
/** El valor de query request. */
|
|
protected QueryRequest queryRequest;
|
|
|
|
/**
|
|
* Metodo que devuelve en forma de bytes un archivo.
|
|
*
|
|
* @param pQueryRequest the query request
|
|
* @return query request
|
|
* @throws Exception la exception
|
|
*/
|
|
@Override
|
|
public QueryRequest process(QueryRequest pQueryRequest) throws Exception {
|
|
this.queryRequest = pQueryRequest;
|
|
Response response = pQueryRequest.getResponse();
|
|
response.put("file", this.getContent());
|
|
response.put("extension", this.getExtension());
|
|
response.put("contentType", this.getContentType());
|
|
return pQueryRequest;
|
|
}
|
|
|
|
/**
|
|
* Obtiene el valor de content.
|
|
*
|
|
* @return Valor de content
|
|
* @throws Exception la exception
|
|
*/
|
|
public abstract byte[] getContent() throws Exception;
|
|
|
|
/**
|
|
* Obtiene el valor de extension.
|
|
*
|
|
* @return Valor de extension
|
|
* @throws Exception la exception
|
|
*/
|
|
public abstract String getExtension() throws Exception;
|
|
|
|
/**
|
|
* Obtiene el valor de content type.
|
|
*
|
|
* @return Valor de content type
|
|
* @throws Exception la exception
|
|
*/
|
|
public abstract String getContentType() throws Exception;
|
|
}
|