Constructor and Description |
---|
ApplicationResourceHolder(Application application,
MarshallService marshallService,
File applicationFolder,
File outputFolder)
Creates a new
ApplicationResourceHolder |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
dumpToCache(ResourceType... types)
Writes all
Resource s to the local caching location. |
ApplicationInfo |
getApplicationInfo()
|
Resource |
getResource(Integer id)
Returns the
Resource with the given ID. |
Resource |
getResource(ResourceType type,
String fileName)
Returns the
Resource of the given type with the given name, if any. |
Set<Resource> |
getResources()
Returns the underlying
Resource |
Set<Resource> |
getResources(ResourceType type)
Returns all
Resource s of the given ResourceType . |
public ApplicationResourceHolder(Application application, MarshallService marshallService, File applicationFolder, File outputFolder) throws InvalidConfigurationException
ApplicationResourceHolder
application
- the Application
that owns the Resources
marshallService
- a MarshallService
using MarshallService.AppNGSchema.APPLICATION
applicationFolder
- the location of the Application
's Resource
s on disc, only needed if the
Application
is filebasedoutputFolder
- the output folder for storing the cached resources of the Application
InvalidConfigurationException
- if no valid application-info.xml could be foundApplication.getResourceSet()
,
Application.isFileBased()
,
dumpToCache(ResourceType...)
public Set<Resource> getResources(ResourceType type)
Resources
Resource
s of the given ResourceType
.getResources
in interface Resources
type
- the ResourceTypeResource
s of the given ResourceType
public void dumpToCache(ResourceType... types)
Resources
Resource
s to the local caching location.dumpToCache
in interface Resources
types
- the types to write the cachefiles forResource.getCachedFile()
public Resource getResource(ResourceType type, String fileName)
Resources
Resource
of the given type with the given name, if any.getResource
in interface Resources
type
- the ResourceType
of the Resource
fileName
- the name of the Resource
Resource
, or null
if no such Resource
exists.public Set<Resource> getResources()
Resources
Resource
getResources
in interface Resources
Resource
spublic Resource getResource(Integer id)
Resources
Resource
with the given ID.getResource
in interface Resources
id
- the ID of the Resource
Resource
, or null
if no such resource exists.public ApplicationInfo getApplicationInfo()
Resources
getApplicationInfo
in interface Resources
ApplicationInfo
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Resources
IOException
Copyright © 2011–2020 aiticon GmbH. All rights reserved.