Package org.openquark.cal.services.ResourcePath

Examples of org.openquark.cal.services.ResourcePath.FilePath


     * @param resourceName the name of the resource.
     * @param createDirectoryIfAbsent whether to create the directory to the file if it does not exist.
     * @return the file which corresponds to that feature.  Note: this file may not exist.
     */
    private File getFeatureFile(ResourceName resourceName, boolean createDirectoryIfAbsent) {
        FilePath resourceFilePath = getResourcePath(resourceName);
        return getResourceFile(resourceFilePath, createDirectoryIfAbsent);
    }
View Full Code Here


     * @param resourceName the identifier of the resource.
     * @param createDirectoryIfAbsent whether to create the directory to the file if it does not exist.
     * @return the file which corresponds to that module.
     */
    File getFeatureFile(ResourceName resourceName, boolean createDirectoryIfAbsent) {
        FilePath resourceFilePath = getResourcePath(resourceName);
        return getNullaryEnvironment().getFile(resourceFilePath, createDirectoryIfAbsent);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public boolean hasFeature(ResourceName resourceName) {
        FilePath filePath = getResourcePath(resourceName);
        return getNullaryEnvironment().exists(filePath);
    }
View Full Code Here

   
    /**
     * {@inheritDoc}
     */
    public InputStream getInputStream(ResourceName resourceName) {
        FilePath filePath = getResourcePath(resourceName);
        return getNullaryEnvironment().getInputStream(filePath, new Status("Input stream status."));
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String getDebugInfo(ResourceName resourceName) {
        FilePath filePath = getResourcePath(resourceName);
        return getNullaryEnvironment().getDebugInfo(filePath);
    }
View Full Code Here

            File resourceFile = null// should be non-null by the time we create the output stream.
           
            if (getResourceType() != ModuleSourceDefinition.RESOURCE_TYPE) {  
                // A module store which is not a cal source store.
                // Attempt to co-locate the module resources with the CAL source file.
                FilePath resourceFilePath = getResourcePath(resourceName);

                // (But don't change the location if the file already exists).
                if (!getNullaryEnvironment().exists(resourceFilePath)) {
                   
                    // Extract the module name (if any) from the resource name.
                    FeatureName featureName = resourceName.getFeatureName();
                    if (featureName instanceof CALFeatureName) {
                       
                        CALFeatureName calFeatureName = (CALFeatureName)featureName;

                        if (calFeatureName.hasModuleName()) {
                            ModuleName moduleName = calFeatureName.toModuleName();

                            // Get the base file path from the path mapper and use this to get the file with the right base folder.
                            ResourceName moduleResourceName = new ResourceName(CALFeatureName.getModuleFeatureName(moduleName));
                            FilePath baseFilePath = CALSourcePathMapper.INSTANCE.getResourcePath(moduleResourceName);
                            resourceFile = getNullaryEnvironment().getFile(baseFilePath, resourceFilePath, true);
                        }
                    }
                }
            }
View Full Code Here

TOP

Related Classes of org.openquark.cal.services.ResourcePath.FilePath

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.