Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.URI.toFileString()


                DirectoryDialog fileDialog = new DirectoryDialog(shell, SWT.OPEN);
                fileDialog.setMessage(Messages.SaveProject_Destination);
                String path = fileDialog.open();

                URI origURI = project.eResource().getURI();
                File file = new File(origURI.toFileString());

                String destinationUdigFolder = path + File.separator + project.getName() + ".udig";
                String destinationProject = destinationUdigFolder + File.separator + file.getName();

                File dest = new File(destinationUdigFolder);
View Full Code Here


    } catch (IllegalArgumentException e) {
      // a more useful error message
      throw new IllegalArgumentException("Failed resolving '" + fileName + "' to relative path '" + absolutePath + "': " + e.getMessage(), e);
    }
    URI tofs = CommonPlugin.resolve(resolved);
    return new File(tofs.toFileString());
  }
 
  /**
   * Get the internal file name associated with this FileReference.
   *
 
View Full Code Here

  private int getCurVersion() throws MalformedURLException
  {
    // TODO: need generalized algorithm here
    URI v2File = getRegistryURI(JSF_LIBRARY_REGISTRY_V2_URL);
    File file = new File(v2File.toFileString());
    if (file.exists())
    {
      return 2;
    }
   
View Full Code Here

    {
      return 2;
    }
   
    URI v1File = getRegistryURI(JSF_LIBRARY_REGISTRY_V1_URL);
    file = new File(v1File.toFileString());
    if (file.exists())
    {
      return 1;
    }
    return NO_VERSION;
View Full Code Here

      options.put(XMLResource.OPTION_DISABLE_NOTIFY, Boolean.TRUE);
      res.load(options);
      //if we got this far then the registry was empty
      //"upgrade" to v2 and then delete old.   no point in upgrade status being sent
      JSFLibraryRegistryUtil.getInstance().saveJSFLibraryRegistry();
      JSFLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString(), newRegURI.toFileString());//save as v2 file 
      JSFLibraryRegistryUpgradeUtil.deleteFile(_v1Registry.toFileString());

      return new UpgradeStatus();//all is ok and no need to alert user
     
    } catch(IOException ioe) {
View Full Code Here

        res.save(Collections.EMPTY_MAP);
        //create v2 xml file
        URI newRegURI =
          JSFLibraryRegistryUpgradeUtil.getRegistryURI
            (JSFLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
        JSFLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString(), newRegURI.toFileString());
        //delete upgraded v1
        JSFLibraryRegistryUpgradeUtil.deleteFile(_v1Registry.toFileString());
        //restore backup to v1 name
        JSFLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString().concat(".bkp"), _v1Registry.toFileString()); //$NON-NLS-1$
        //Alert end user
View Full Code Here

  private int getCurVersion() throws MalformedURLException
  {
    // TODO: need generalized algorithm here
    URI v2File = getRegistryURI(JSF_LIBRARY_REGISTRY_V2_URL);
    File file = new File(v2File.toFileString());
    if (file.exists())
    {
      return 2;
    }
   
View Full Code Here

    {
      return 2;
    }
   
    URI v1File = getRegistryURI(JSF_LIBRARY_REGISTRY_V1_URL);
    file = new File(v1File.toFileString());
    if (file.exists())
    {
      return 1;
    }
    return NO_VERSION;
View Full Code Here

      options.put(XMLResource.OPTION_DISABLE_NOTIFY, Boolean.TRUE);
      res.load(options);
      //if we got this far then the registry was empty
      //"upgrade" to v2 and then delete old.   no point in upgrade status being sent
      TapestryLibraryRegistryUtil.getInstance().saveJSFLibraryRegistry();
      TapestryLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString(), newRegURI.toFileString());//save as v2 file 
      TapestryLibraryRegistryUpgradeUtil.deleteFile(_v1Registry.toFileString());

      return new UpgradeStatus();//all is ok and no need to alert user
     
    } catch(IOException ioe) {
View Full Code Here

        res.save(Collections.EMPTY_MAP);
        //create v2 xml file
        URI newRegURI =
          TapestryLibraryRegistryUpgradeUtil.getRegistryURI
            (TapestryLibraryRegistryUpgradeUtil.JSF_LIBRARY_REGISTRY_V2_URL);
        TapestryLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString(), newRegURI.toFileString());
        //delete upgraded v1
        TapestryLibraryRegistryUpgradeUtil.deleteFile(_v1Registry.toFileString());
        //restore backup to v1 name
        TapestryLibraryRegistryUpgradeUtil.copyFile(_v1Registry.toFileString().concat(".bkp"), _v1Registry.toFileString()); //$NON-NLS-1$
        //Alert end user
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.