public InputStreamWrapper(InputStream delegate) { super(); Lang.denyNull("delegate", delegate); this.delegate = delegate; }
@Override protected void destroyTarget(OutputStream target) { Lang.closeQuietly(target); }
public static File getUserHome() throws Exception { return getOrFailDirectory("user home", System.getProperty("user.home")); }
/** * Creates an {@link EventMulticaster} for the specified subscriber type. The {@link EventMulticaster} created will * forward thrown exceptions from subscribers. <b>Note: An exception aborts the notifaction of further * subscribers.</b> * * @param subscriberType * The subscriber interface. * * @return Returns the {@link EventMulticaster}. */ public static <I> EventMulticaster<I> create(Class<I> subscriberType) { Lang.denyNull("subscriber type", subscriberType); ReflectionUtil.denyNotInterface(subscriberType); MulticastHandler<I> handler = new MulticastHandler<I>(subscriberType); return handler; }
private void addFileInfo(String label, File directory, Panel panel) { String absolutePath = directory.getAbsolutePath(); boolean accessible = false; if (directory.isDirectory()) { accessible = Files.isAccessibleDirectory(directory); } else { accessible = Files.isAccessibleFile(directory); } addInfo(label, absolutePath, toYesNo(accessible), panel); }
public File getCreateOrFailDeployDirectory() throws Exception { checkState(); File deployFolder = getDeployDirectoryUnchecked(); createIfMissingDirectory(deployFolder); return getOrFailDirectory("deploy", deployFolder); }
@SuppressWarnings("unchecked") protected I createMulticasterProxy(Class<I> subscriberInterface, InvocationHandler handler) { ClassLoader classLoader = ReflectionUtil.getClassLoader(getClass()); Object proxy = Proxy.newProxyInstance(classLoader, new Class[] { subscriberInterface }, handler); return (I) proxy; }
@Override public File getDeployDirectoryUnchecked() { checkState(); File deployFolder = new File(getCurrentDirectory(), deployFolder()); return deployFolder; }
public ThreadSensitiveRecorderStream(OutputStream delegate) { Lang.denyNull("delegate", delegate); this.delegate = delegate; this.recordSubscriber = new ConcurrentHashMap<ClassloaderThreadID, ByteArrayOutputStream>(); }
public File getCreateOrFailWorkDirectory() throws Exception { checkState(); File folder = getWorkDirectoryUnchecked(); createIfMissingDirectory(folder); return getOrFailDirectory("work", folder); }
public File getOrFailPluginDirectory(String deployName) throws Exception { checkState(); return getOrFailDirectory("plugin", getPluginDirectoryUnchecked(deployName)); }
@Override public boolean hasClasspath(String deployName) { Lang.denyNull("deployName", deployName); return deploynames.containsKey(deployName); }
public File getOrFailWorkDirectory() throws Exception { checkState(); return getOrFailDirectory("work", getWorkDirectoryUnchecked()); }
public File getOrFailDeployDir() throws Exception { checkState(); return getOrFailDirectory("deploy", getDeployDirectoryUnchecked()); }
public boolean containsKey(Object key) { Lang.denyNull("key", key); return properties.containsKey(key); }
public String getProperty(String key) { Lang.denyNull("key", key); return properties.getProperty(key); }
protected void setDelegate(OutputStream delegate) { Lang.denyNull("delegate", delegate); delegateLock.lock(); try { this.delegate = delegate; } finally { delegateLock.unlock(); } }
@SuppressWarnings({ "unchecked", "rawtypes" }) static void addThreadLocals(Set<ThreadLocal> threadLocalsSet) { Lang.denyNull("ThreadLocals", threadLocalsSet); for (ThreadLocal threadLocal : threadLocalsSet) { // Stores a new thread local in the current thread threadLocal.set(threadLocal.get()); } }
public PluginClassLoader(LimbusFileService filesystem, ClassLoader parent, Set<URL> urls) { this(filesystem, Lang.denyNull("parent", parent), urls.toArray(new URL[urls.size()])); }