Package org.openbel.framework.core.df.cache

Examples of org.openbel.framework.core.df.cache.ResourceType


    public void purgeResources() throws IOException {
        File cacheDirectory = getSystemConfiguration().getCacheDirectory();

        for (File cacheFile : cacheDirectory.listFiles()) {
            if (cacheFile.isDirectory()) {
                ResourceType rt = ResourceType.fromFolder(cacheFile.getName());
                if (rt != null) {
                    // we own it, so delete it.
                    deleteDirectory(cacheFile);
                    reportable.output("Deleted cache directory: "
                            + cacheFile.getAbsolutePath());
View Full Code Here


            return pn;
        }

        String pfLocation = pfResource.getResourceLocation();
        File pfamResource = null;
        final ResourceType pfamType = fromLocation(pfLocation);
        try {
            ResolvedResource resolvedResource =
                    cache.resolveResource(pfamType, pfLocation);
            pfamResource = resolvedResource.getCacheResourceCopy();
        } catch (ResourceDownloadError e) {
View Full Code Here

            return pn;
        }

        String ncLocation = ncResource.getResourceLocation();
        File ncFile = null;
        final ResourceType ncType = fromLocation(ncLocation);
        try {
            ResolvedResource resolvedResource = cache.resolveResource(
                    ncType, ncLocation);
            ncFile = resolvedResource.getCacheResourceCopy();
        } catch (ResourceDownloadError e) {
View Full Code Here

        }

        // TODO Timing for cache resolving.
        String gsloc = gsResource.getResourceLocation();
        File gsFile = null;
        final ResourceType gsType = fromLocation(gsloc);
        try {
            ResolvedResource resolvedResource = cache.resolveResource(gsType,
                    gsloc);
            gsFile = resolvedResource.getCacheResourceCopy();
        } catch (ResourceDownloadError e) {
View Full Code Here

        return opn;
    }

    private Document readResource(final ResourceLocation resource) {
        final String rloc = resource.getResourceLocation();
        final ResourceType type = fromLocation(rloc);

        File res = null;
        try {
            final ResolvedResource rsv = cache.resolveResource(type, rloc);
            res = rsv.getCacheResourceCopy();
View Full Code Here

        String resourceLocation = option.getValue();

        reportable.output("Loading resource into the cache:");
        reportable.output("  " + resourceLocation);

        ResourceType type = ResourceType.fromLocation(resourceLocation);

        if (type == null) {
            reportable
                    .error("Resource type cannot be determined, consult help with -h.");
            bail(GENERAL_FAILURE);
View Full Code Here

TOP

Related Classes of org.openbel.framework.core.df.cache.ResourceType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.