use of lucee.runtime.exp.PageRuntimeException in project Lucee by lucee.
the class DatasourceResourceProvider method create.
public void create(ConnectionData data, int fullPathHash, int pathHash, String path, String name, int type) throws IOException {
if (StringUtil.isEmpty(data.getDatasourceName()))
throw new IOException("missing datasource definition");
removeFromCache(data, path, name);
DatasourceConnection dc = null;
try {
dc = getDatasourceConnection(data);
getCore(data).create(dc, data.getPrefix(), fullPathHash, pathHash, path, name, type);
} catch (SQLException e) {
throw new IOException(e.getMessage());
} catch (PageException e) {
throw new PageRuntimeException(e);
} finally {
release(dc);
}
}
use of lucee.runtime.exp.PageRuntimeException in project Lucee by lucee.
the class DatasourceResourceProvider method getInputStream.
public InputStream getInputStream(ConnectionData data, int fullPathHash, String path, String name) throws IOException {
Attr attr = getAttr(data, fullPathHash, path, name);
if (attr == null)
throw new IOException("file [" + path + name + "] does not exist");
DatasourceConnection dc = null;
try {
dc = getDatasourceConnection(data);
return getCore(data).getInputStream(dc, data.getPrefix(), attr);
} catch (SQLException e) {
throw new IOException(e.getMessage());
} catch (PageException e) {
throw new PageRuntimeException(e);
} finally {
release(dc);
// manager.releaseConnection(CONNECTION_ID,dc);
}
}
Aggregations