TrueUpdate Core 0.4

net.java.trueupdate.core.io
Class Sources

java.lang.Object
  extended by net.java.trueupdate.core.io.Sources

@Immutable
public class Sources
extends Object

Provides functions for Sources.

Author:
Christian Schlichtherle (copied and edited from TrueLicense Core 2.3.1)

Nested Class Summary
static interface Sources.ExecuteStatement<V,X extends Exception>
           
 
Method Summary
static
<V,X extends Exception>
Sources.ExecuteStatement<V,X>
execute(InputTask<V,X> task)
           
static Source forResource(String name, ClassLoader loader)
          Returns a source which loads the resource with the given name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

execute

public static <V,X extends Exception> Sources.ExecuteStatement<V,X> execute(InputTask<V,X> task)

forResource

public static Source forResource(String name,
                                 @CheckForNull
                                 ClassLoader loader)
Returns a source which loads the resource with the given name. If the given class loader is not null, then the resource will get loaded as described in ClassLoader.getResourceAsStream(String). Otherwise, the resource will get loaded as described in ClassLoader.getSystemResourceAsStream(String).

Parameters:
name - the name of the resource to load.
loader - the nullable class loader to use for loading the resource. If this is null, then the system class loader will get used.
Returns:
A source which loads the resource with the given name.

TrueUpdate Core 0.4

Copyright © 2013 Schlichtherle IT Services. All rights reserved.