@Override public int hashCode() { int result = pluginJar.hashCode(); result = 31 * result + (pluginProviderDefs != null ? pluginProviderDefs.hashCode() : 0); result = 31 * result + (mainAttributes != null ? mainAttributes.hashCode() : 0); result = 31 * result + (classCache != null ? classCache.hashCode() : 0); return result; }
/** Retrieve a servable file by its hashcode. */ public File getFile(String hash) { try { int h = Integer.valueOf(hash); for (File f : files) { if (f.hashCode() == h) { return f; } } } catch (NumberFormatException e) { } return null; }
/** * Register a file as servable. * * @return its hashcode (for use as a 'filename' in an http path) */ public int add(File f) { files.add(f); return f.hashCode(); }