Package de.hsh.graja.transform
Class TransformFromResourceDBToLocal
- java.lang.Object
-
- de.hsh.graja.transform.TransformFromResourceDBToLocal
-
public class TransformFromResourceDBToLocal extends Object
This class can convert anIdentifiableResourceTO
object to aResourceLocalFileTO
object by searching the id in the local resource database and linking to the corresponding local file.
-
-
Constructor Summary
Constructors Constructor Description TransformFromResourceDBToLocal()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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)
-
-
-
Method Detail
-
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
-
-