// private final byte[] getResource(String name) { private byte[] getResource(String name) { byte[] resource; resource = resourcescache.get(name); if (resource == null) { // Primero trato de obtenerlo de la tabla de recursos try { resource = (byte[]) m_resourcebytes.find(name); resourcescache.put(name, resource); } catch (BasicException e) { resource = null; } } return resource; }
public final void setResource(String name, int type, byte[] data) { Object[] value = new Object[] {UUID.randomUUID().toString(), name, new Integer(type), data}; try { if (m_resourcebytesupdate.exec(value) == 0) { m_resourcebytesinsert.exec(value); } resourcescache.put(name, data); } catch (BasicException e) { } }