org.mule.devkit.generation.studio.utils
Class MuleStudioPathResolver

java.lang.Object
  extended by org.mule.devkit.generation.studio.utils.MuleStudioPathResolver

public class MuleStudioPathResolver
extends Object

Utility class to help resolving paths within a DevKit's project


Constructor Summary
MuleStudioPathResolver()
           
 
Method Summary
static File getFileResolvingPackages(org.mule.devkit.model.module.Module module, String relativeFilePath)
          Given a module and a relativeFilePath, it creates a File and returns it.
static String getPathWithoutPackages(org.mule.devkit.model.module.Module module)
          Given a module, it returns the full path to the source file removing all the packages it has.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MuleStudioPathResolver

public MuleStudioPathResolver()
Method Detail

getPathWithoutPackages

public static String getPathWithoutPackages(org.mule.devkit.model.module.Module module)
Given a module, it returns the full path to the source file removing all the packages it has.

Sample: The connector is under firstPackage.secondPackage.HelloConnector.java, which means a full path like the following, /Users//Hello-Connector/src/main/java/firstPackage/secondPackage/HelloConnector.java. The returned string will be "/Users//Hello-Connector/src/main/java"

Parameters:
module - The module to reference with
Returns:
the path to the java class where your concrete class is

getFileResolvingPackages

public static File getFileResolvingPackages(org.mule.devkit.model.module.Module module,
                                            String relativeFilePath)
Given a module and a relativeFilePath, it creates a File and returns it. Keep in mind the relativeFilePath should be relative to the actual module, which means that if you want to access a root level, "../" must be added.

Sample:

  1. The connector is under firstPackage.secondPackage.HelloConnector.java, which means a full path like the following, /Users//Hello-Connector/src/main/java/firstPackage/secondPackage/HelloConnector.java.
  2. If you want to access /Users//Hello-Connector/some/folder/file.txt, relativeFilePath must have the value of "../../../some/folder/file.txt"

Parameters:
module - The module to reference with
relativeFilePath - the file to access (must be relative to the module/connector folder file)
Returns:
a File with the concrete file (recommended use after calling this method is File.exists())
See Also:
#getPathWithoutPackages(org.mule.devkit.model.module.Module)}


Copyright © 2010–2014 MuleSoft, Inc.. All rights reserved.