Package org.eclipse.emf.common.util

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


          //Diagram Editor, possibly other types of editor
          Object test1 = in.getAdapter(ResourceSet.class);
          for (Resource r : ((ResourceSet) test1).getResources()) {
            if (r instanceof DispelResource) {
              URI resolvedFile = CommonPlugin.resolve(r.getURI());
              IPath path = new Path(resolvedFile.toFileString());
              return ResourcesPlugin.getWorkspace().getRoot(
                  ).getFileForLocation(path);
            }
          }
        }
View Full Code Here


  public OutputStream createOutputStream(URI uri) throws IOException
  {
    URI converted = normalize(uri);
    if (converted.isFile())
    {
      String filePath = converted.toFileString();
      return createFileOutputStream(filePath);
    }
    else
    {
      String scheme = converted.scheme();
View Full Code Here

  public InputStream createInputStream(URI uri) throws IOException
  {
    URI converted = normalize(uri);
    if (converted.isFile())
    {
      String filePath = converted.toFileString();
      return createFileInputStream(filePath);
    }
    else
    {
      String scheme = converted.scheme();
View Full Code Here

        EcoreDiagramEditorUtil.createDiagramOnly(diagramURI, modelURI,
            domainElement, true, new NullProgressMonitor());
      }
    });

    new File(diagramURI.toFileString()).deleteOnExit();
    return new EcoreToolsGMFDiagramURI(diagramURI);
  }

  private EObject getDomainRootElement(URI uri) {
    ResourceSet resourceSet = new ResourceSetImpl();
View Full Code Here

   * @generated
   */
  private static File getFile(Resource resource) {
    URI resourceUri = resource.getURI();
    if (resourceUri != null && resourceUri.isFile()) {
      File file = new File(resourceUri.toFileString());
      if (!file.isDirectory()) {
        return file;
      }
    }
    return null;
View Full Code Here

      buffer.flip();
      while (buffer.hasRemaining()) {
        outChannel.write(buffer);
      }
      outChannel.close();
      return outPath.toFileString();
    } catch (IOException e) {
      // TODO Auto-generated catch block
      logger.error(e);
      return null;
    }
View Full Code Here

public class PDFImageUtil {

  public static String calcStyle(ImageRef ref) throws IOException {
    URI uri = ref.eResource().getURI();
    URI inPath = URI.createURI(ref.getPath()).resolve(uri);
    ImageInputStream img = ImageIO.createImageInputStream(new File(inPath.toFileString()));
    Iterator<ImageReader> imageReaders = ImageIO.getImageReaders(img);
    ImageReader ir = imageReaders.next();
    ir.setInput(img);
    IIOMetadata imageMetadata = ir.getImageMetadata(0);
    Node n = imageMetadata.getAsTree("javax_imageio_1.0");
View Full Code Here

        String _string = _trimSegments.toString();
        String _plus = (_string + "/");
        String _path = ref.getPath();
        String _plus_1 = (_plus + _path);
        final URI inPath = URI.createURI(_plus_1);
        String _fileString = inPath.toFileString();
        File _file = new File(_fileString);
        final ImageInputStream img = ImageIO.createImageInputStream(_file);
        final Iterator<ImageReader> imageReaders = ImageIO.getImageReaders(img);
        final ImageReader ir = imageReaders.next();
        ir.setInput(img);
View Full Code Here

              URI resourceURI = eObjectDescription.getEObjectURI().trimFragment();
              if(resourceURI.isPlatform()) {
                messageLabel.setText(resourceURI.toPlatformString(true));
              }
              else if(resourceURI.isFile()) {
                messageLabel.setText(resourceURI.toFileString());
              }
              else {
                messageLabel.setText(resourceURI.toString());
              }
              return;
View Full Code Here

        if(location == null) {
          location = defaultLocation;
        }

        location = location.appendSegment(".project"); //$NON-NLS-1$
        File projectFile = new File(location.toFileString());

        if(projectFile.exists()) {
          projectFile.renameTo(new File(location.toString() + ".old")); //$NON-NLS-1$
        }
      }
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.