Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileSystemManager.resolveFile()


    if (_properties == null) {
      TemporaryFile tempFile = null;
      try {       
        tempFile = new TemporaryFile("template_" + _name, getContent(), WGADesignerPlugin.getDefault().getStateLocation().toFile());
        FileSystemManager fsManager = VFS.getManager();
        FileObject propFile = fsManager.resolveFile("zip:" + tempFile.getFile().toURI() + "!" + PROPERTIES_FILENAME);
        if (propFile.exists()) {
          _properties = new Properties();
          InputStream propIn = null;
          try {
            propIn = propFile.getContent().getInputStream();
View Full Code Here


  public void createOrUpdateDefaultDeployment(File defaultWGAWar, IProgressMonitor monitor) throws FileSystemException, IOException, ZipException {
    if (monitor == null) {
      monitor = new NullProgressMonitor();
    }
    FileSystemManager fsManager = VFS.getManager();
    FileObject propFile = fsManager.resolveFile( "zip:" + defaultWGAWar.toURI() + "!/WEB-INF/wgabuild.properties");
    //_defaultDeploymentName = DEFAULT_DEPLOYMENT_PREFIX + WGADeployment.determineWGAVersion(propFile.getURL().openStream(), "_", true, false);
       
    // init default wga installation
    // check if we already have a deployment with same major, minor version
    WGADeployment existingDefaultDeployment = getDeployment(DEFAULT_DEPLOYMENT_NAME);
View Full Code Here

  public static boolean isWGAVersionSupported(File wgaWar) {
    InputStream propIn = null;
    try {
      FileSystemManager fsManager = VFS.getManager();
      FileObject propFile = fsManager.resolveFile( "zip:" + wgaWar.toURI() + "!/WEB-INF/wgabuild.properties");
      propIn = propFile.getURL().openStream();
      Version version = WGADeployment.determineWGAVersion(propIn);
      if (version != null) {
        if (version.isAtLeast(Activator.SUPPORTED_WGA_VERSION_MIN.getMajor(),  Activator.SUPPORTED_WGA_VERSION_MIN.getMinor())) {
          if (version.getMajorVersion() < Activator.SUPPORTED_WGA_VERSION_MAX.getMajor()) {
View Full Code Here

            try
            {
                FileSystemManager mgr = VFS.getManager();
                System.out.println();
                System.out.println("Parsing: " + args[i]);
                FileObject file = mgr.resolveFile(args[i]);
                System.out.println("URL: " + file.getURL());
                System.out.println("getName(): " + file.getName());
                System.out.println("BaseName: " + file.getName().getBaseName());
                System.out.println("Extension: " + file.getName().getExtension());
                System.out.println("Path: " + file.getName().getPath());
View Full Code Here

  public static void main(String[] args) throws FileSystemException
  {
    FileSystemManager mgr = VFS.getManager();

    FileObject root = mgr
        .resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr");
    FileName rootName = root.getName();
 
    testNames(mgr, rootName);
View Full Code Here

    FileSystemManager fsManager = VFS.getManager();
    for (String jar : _jar2class.keySet())
    {
      FileObject jarFile;
      if (jar.endsWith(".jar"))
        jarFile = fsManager.resolveFile( "jar:"+jar );
      else
        jarFile = fsManager.resolveFile( jar );
       
        for (String file : _jar2class.get(jar))
        {
View Full Code Here

    {
      FileObject jarFile;
      if (jar.endsWith(".jar"))
        jarFile = fsManager.resolveFile( "jar:"+jar );
      else
        jarFile = fsManager.resolveFile( jar );
       
        for (String file : _jar2class.get(jar))
        {
          file = file.replaceAll("\\.", "/");
          file += ".class";
View Full Code Here

       
        for (String file : _jar2class.get(jar))
        {
          file = file.replaceAll("\\.", "/");
          file += ".class";
          FileObject f = fsManager.resolveFile(jarFile, file);
          if (f.exists())
            addFile(f, file, out);
          else
            System.out.println("file not found "+f);
       
View Full Code Here

    initialize();
      while (reader == null) {
        getLogger().info("attempting to load file: " + getFileURL());
        try {
          FileSystemManager fileSystemManager = VFS.getManager();
          FileObject fileObject = fileSystemManager.resolveFile(getFileURL());
          reader = new InputStreamReader(fileObject.getContent().getInputStream());
        } catch (FileSystemException fse) {
          getLogger().info("file not available - will try again in 10 seconds");
          synchronized(this) {
            try {
View Full Code Here

  public static void main(String[] args) throws FileSystemException
  {
    FileSystemManager mgr = VFS.getManager();

    FileObject root = mgr
        .resolveFile("smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr");
    FileName rootName = root.getName();
 
    testNames(mgr, rootName);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.