Issue #5129 - Resource.fromReferences no longer needs DefaultFactory

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2020-08-10 14:42:02 -05:00
parent e8098986e6
commit 52f5218900
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 2 additions and 13 deletions

View File

@ -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);
}
/**