Package de.hsh.graja.transform
Class TransformFromResourceDBToLocal
java.lang.Object
de.hsh.graja.transform.TransformFromResourceDBToLocal
This class can convert an
IdentifiableResourceTO
object to a
ResourceLocalFileTO
object by searching the id in the local resource database
and linking to the corresponding local file.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceLocalFileTO
convertToResourceLocalFileTO
(ResourceTO resource, MutableBoolean flagNonLocal) If the resource is an identifiable resource, this method will create aResourceLocalFileTO
from it.static List<ResourceLocalFileTO>
convertToResourcesLocalFileTO
(List<ResourceTO> resources, MutableBoolean flagNonLocal)
-
Constructor Details
-
TransformFromResourceDBToLocal
public TransformFromResourceDBToLocal()
-
-
Method Details
-
convertToResourceLocalFileTO
public static ResourceLocalFileTO convertToResourceLocalFileTO(ResourceTO resource, MutableBoolean flagNonLocal) throws IllegalArgumentException, IOException If the resource is an identifiable resource, this method will create aResourceLocalFileTO
from it. Otherwise, this method will simply return the parameter.- Parameters:
resource
- the input resourceflagNonLocal
- inout parameter. Will be or-concatenated with true, if the resource has been converted to a local resource. Will remain unchanged, if the resource is local already.- Returns:
- the newly created
ResourceLocalFileTO
or (in case of resource being local already) simply the actual parameter value. - Throws:
IllegalArgumentException
- thrown, if the resource cannot be converted to a local resource. Reasons could be, that the id is missing or unknown or that the resource database is not accessible or corrupt.IOException
- other I/O errors
-
convertToResourcesLocalFileTO
public static List<ResourceLocalFileTO> convertToResourcesLocalFileTO(List<ResourceTO> resources, MutableBoolean flagNonLocal) throws IllegalArgumentException, IOException - Throws:
IllegalArgumentException
IOException
-