Issue #5129 - Resource.fromReferences no longer needs DefaultFactory
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
e8098986e6
commit
52f5218900
|
@ -1006,7 +1006,7 @@ public abstract class Resource implements ResourceFactory, Closeable
|
|||
* Create a new Resource from the factory's point of view.
|
||||
* <p>
|
||||
* This is different then {@link ResourceFactory} in that
|
||||
* it must return a {@link Resource} or throw an Exception,
|
||||
* it must return a {@link Resource} or throw an IOException,
|
||||
* never null.
|
||||
* </p>
|
||||
*
|
||||
|
@ -1017,17 +1017,6 @@ public abstract class Resource implements ResourceFactory, Closeable
|
|||
Resource newResource(String reference) throws IOException;
|
||||
}
|
||||
|
||||
private static class DefaultFactory implements Factory
|
||||
{
|
||||
public static final Factory INSTANCE = new DefaultFactory();
|
||||
|
||||
@Override
|
||||
public Resource newResource(String reference) throws IOException
|
||||
{
|
||||
return Resource.newResource(reference);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse a delimited String of resource references and
|
||||
* return the List of Resources instances it represents.
|
||||
|
@ -1043,7 +1032,7 @@ public abstract class Resource implements ResourceFactory, Closeable
|
|||
*/
|
||||
public static List<Resource> fromReferences(String delimitedReferences) throws IOException
|
||||
{
|
||||
return fromReferences(delimitedReferences, DefaultFactory.INSTANCE);
|
||||
return fromReferences(delimitedReferences, Resource::newResource);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue