public String getClassName() { if (!"class".equals(getExtension())) throw new RuntimeException("Not a valid class name: " + getAbsolutePath()); return getRelativePath().substring(0, getRelativePath().length() - 6).replace('/', '.'); }
public byte[] getContent() throws IOException { long size = getSize(); if (size > Integer.MAX_VALUE) throw new IOException("Size over Integer.MAX_VALUE: " + size); InputStream is = null; try { is = getInputStream(); byte[] data = new byte[(int)size]; is.read(data); return data; } finally { if (is != null) is.close(); } }
public Class<?> loadAsClass() throws ClassNotFoundException, IOException, ClassFormatError { if (clazz == null) { ClassLoader loader = scanner.getLoader(); if (loader instanceof ScannedItemClassLoader) clazz = ((ScannedItemClassLoader)loader).loadClass(this); else clazz = loader.loadClass(getClassName()); } return clazz; }
@Override public String toString() { if (marker != null) return getAbsolutePath() + " [marker=" + marker + "]"; return getAbsolutePath(); } }
public String getExtension() { String name = getName(); int lastDot = name.indexOf('.'); return lastDot >= 0 ? name.substring(lastDot + 1) : null; }
public Properties loadAsProperties() throws IOException, IllegalArgumentException { if (properties == null) { InputStream is = null; try { is = getInputStream(); properties = new Properties(); properties.load(getInputStream()); } finally { if (is != null) is.close(); } } return properties; }
public Class<?> loadAsClass() throws ClassNotFoundException, IOException, ClassFormatError { if (clazz == null) { ClassLoader loader = scanner.getLoader(); if (loader instanceof ScannedItemClassLoader) clazz = ((ScannedItemClassLoader)loader).loadClass(this); else clazz = loader.loadClass(getClassName()); } return clazz; }
@Override public String toString() { if (marker != null) return getAbsolutePath() + " [marker=" + marker + "]"; return getAbsolutePath(); } }
public String getExtension() { String name = getName(); int lastDot = name.indexOf('.'); return lastDot >= 0 ? name.substring(lastDot + 1) : null; }
public Properties loadAsProperties() throws IOException, IllegalArgumentException { if (properties == null) { InputStream is = null; try { is = getInputStream(); properties = new Properties(); properties.load(getInputStream()); } finally { if (is != null) is.close(); } } return properties; }
public String getClassName() { if (!"class".equals(getExtension())) throw new RuntimeException("Not a valid class name: " + getAbsolutePath()); return getRelativePath().substring(0, getRelativePath().length() - 6).replace('/', '.'); }
public byte[] getContent() throws IOException { long size = getSize(); if (size > Integer.MAX_VALUE) throw new IOException("Size over Integer.MAX_VALUE: " + size); InputStream is = null; try { is = getInputStream(); byte[] data = new byte[(int)size]; is.read(data); return data; } finally { if (is != null) is.close(); } }
public Class<?> loadAsClass() throws ClassNotFoundException, IOException, ClassFormatError { if (clazz == null) { ClassLoader loader = scanner.getLoader(); if (loader instanceof ScannedItemClassLoader) clazz = ((ScannedItemClassLoader)loader).loadClass(this); else clazz = loader.loadClass(getClassName()); } return clazz; }
@Override public String toString() { if (marker != null) return getAbsolutePath() + " [marker=" + marker + "]"; return getAbsolutePath(); } }
public String getExtension() { String name = getName(); int lastDot = name.indexOf('.'); return lastDot >= 0 ? name.substring(lastDot + 1) : null; }
public Properties loadAsProperties() throws IOException, IllegalArgumentException { if (properties == null) { InputStream is = null; try { is = getInputStream(); properties = new Properties(); properties.load(getInputStream()); } finally { if (is != null) is.close(); } } return properties; }
public String getClassName() { if (!"class".equals(getExtension())) throw new RuntimeException("Not a valid class name: " + getAbsolutePath()); return getRelativePath().substring(0, getRelativePath().length() - 6).replace('/', '.'); }
public byte[] getContent() throws IOException { long size = getSize(); if (size > Integer.MAX_VALUE) throw new IOException("Size over Integer.MAX_VALUE: " + size); InputStream is = null; try { is = getInputStream(); byte[] data = new byte[(int)size]; is.read(data); return data; } finally { if (is != null) is.close(); } }
public Class<?> loadAsClass() throws ClassNotFoundException, IOException, ClassFormatError { if (clazz == null) { ClassLoader loader = scanner.getLoader(); if (loader instanceof ScannedItemClassLoader) clazz = ((ScannedItemClassLoader)loader).loadClass(this); else clazz = loader.loadClass(getClassName()); } return clazz; }
@Override public String toString() { if (marker != null) return getAbsolutePath() + " [marker=" + marker + "]"; return getAbsolutePath(); } }