Examples of URIConverter


Examples of org.eclipse.emf.ecore.resource.URIConverter

   */
  public void load(Map<?, ?> options) throws IOException
  {
    if (!isLoaded)
    {
      URIConverter uriConverter = getURIConverter();
      Map<?, ?> response = options == null ? null : (Map<?, ?>)options.get(URIConverter.OPTION_RESPONSE);
      if (response == null)
      {
        response = new HashMap<Object, Object>();
      }

      // If an input stream can't be created, ensure that the resource is still considered loaded after the failure,
      // and do all the same processing we'd do if we actually were able to create a valid input stream.
      //
      InputStream inputStream = null;
      try
      {
        inputStream =
          uriConverter.createInputStream
            (getURI(),
             new ExtensibleURIConverterImpl.OptionsMap(URIConverter.OPTION_RESPONSE, response, options, defaultLoadOptions));
      }
      catch (IOException exception)
      {
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.URIConverter

        String _plus_2 = (_string_1 + "/");
        String _replaceAll = fromRelativeFileName.replaceAll("\\.\\.", "");
        String _plus_3 = (_plus_2 + _replaceAll);
        final URI outPath = URI.createURI(_plus_3);
        ResourceSet _resourceSet = res.getResourceSet();
        URIConverter _uRIConverter = _resourceSet.getURIConverter();
        InputStream _createInputStream = _uRIConverter.createInputStream(inPath);
        final ReadableByteChannel inChannel = Channels.newChannel(_createInputStream);
        ResourceSet _resourceSet_1 = res.getResourceSet();
        URIConverter _uRIConverter_1 = _resourceSet_1.getURIConverter();
        OutputStream _createOutputStream = _uRIConverter_1.createOutputStream(outPath);
        final WritableByteChannel outChannel = Channels.newChannel(_createOutputStream);
        while ((new Function0<Integer>() {
          public Integer apply() {
            try {
              int _read = inChannel.read(buffer);
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.URIConverter

        String _plus = (_string + "/");
        String _plus_1 = (_plus + fromRelativeFileName);
        final URI inPath = URI.createURI(_plus_1);
        final URI outPath = this.accessExtension2.getURI(fromRelativeFileName, Outlets.ECLIPSE_HELP);
        ResourceSet _resourceSet = res.getResourceSet();
        URIConverter _uRIConverter = _resourceSet.getURIConverter();
        InputStream _createInputStream = _uRIConverter.createInputStream(inPath);
        final ReadableByteChannel inChannel = Channels.newChannel(_createInputStream);
        ResourceSet _resourceSet_1 = res.getResourceSet();
        URIConverter _uRIConverter_1 = _resourceSet_1.getURIConverter();
        OutputStream _createOutputStream = _uRIConverter_1.createOutputStream(outPath);
        final WritableByteChannel outChannel = Channels.newChannel(_createOutputStream);
        while ((new Function0<Integer>() {
          public Integer apply() {
            try {
              int _read = inChannel.read(buffer);
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.URIConverter

    try {
      final Resource res = imgRef.eResource();
      final ByteBuffer buffer = ByteBuffer.allocateDirect((16 * 1024));
      final URI uri = res.getURI();
      ResourceSet _resourceSet = res.getResourceSet();
      final URIConverter uriConverter = _resourceSet.getURIConverter();
      File _file = new File("");
      String _absolutePath = _file.getAbsolutePath();
      String _plus = (_absolutePath + "/");
      final URI absoluteLocalPath = URI.createFileURI(_plus);
      String _path = imgRef.getPath();
      final URI relativeImageURI = URI.createFileURI(_path);
      URI _resolve = relativeImageURI.resolve(uri);
      final URI inPath = _resolve.deresolve(absoluteLocalPath);
      List<String> _segmentsList = inPath.segmentsList();
      int _segmentCount = inPath.segmentCount();
      final List<String> inSegments = _segmentsList.subList(1, _segmentCount);
      final String pathInDocument = IterableExtensions.join(inSegments, "/");
      Object _get = this.config.get(Config.outletPath);
      String _string = _get.toString();
      String _plus_1 = (_string + "/");
      String _plus_2 = (_plus_1 + pathInDocument);
      final URI outPath = URI.createFileURI(_plus_2);
      InputStream _createInputStream = uriConverter.createInputStream(inPath);
      final ReadableByteChannel inChannel = Channels.newChannel(_createInputStream);
      ResourceSet _resourceSet_1 = res.getResourceSet();
      URIConverter _uRIConverter = _resourceSet_1.getURIConverter();
      OutputStream _createOutputStream = _uRIConverter.createOutputStream(outPath);
      final WritableByteChannel outChannel = Channels.newChannel(_createOutputStream);
      while ((new Function0<Integer>() {
        public Integer apply() {
          try {
            int _read = inChannel.read(buffer);
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.URIConverter

  protected org.eclipse.emf.common.util.URI createURI(EObject o) {
    IEObjectDescription target = documentationProvider.xref(o);
    if(target == null)
      return null; // should disable the link as well

    final URIConverter uriConverter = o.eResource().getResourceSet().getURIConverter();
    final URI uri = target.getEObjectURI();
    final URI normalized = uriConverter.normalize(uri);
    return normalized;
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.URIConverter

  public void createHyperlinksTo(XtextResource from, Region region, IEObjectDescription to,
      IHyperlinkAcceptor acceptor) {
    if(!isAcceptableTarget(to))
      return;
    final URIConverter uriConverter = from.getResourceSet().getURIConverter();
    final String hyperlinkText = labelProvider.getText(to);
    final URI uri = to.getEObjectURI();
    final URI normalized = uriConverter.normalize(uri);

    XtextHyperlink result = getHyperlinkProvider().get();
    result.setHyperlinkRegion(region);
    result.setURI(normalized);
    result.setHyperlinkText(hyperlinkText);
View Full Code Here

Examples of org.eclipse.emf.ecore.resource.URIConverter

      // use an URI Converter to allow possible model extender to rewrite
      // URI
      // TODO replace with ExtensibleURIConverterImpl once EMF dep moves
      // up to 2.4
      URIConverter uriConverter = new URIConverterImpl();
      URI uri = uriConverter.normalize(URI.createURI(name));

      // set Authority to host and port of the service
      final java.net.URI location = anIServiceInfo.getLocation();
      final String authority = location.getAuthority();
      uri = URI.createHierarchicalURI(uri.scheme(), authority,
View Full Code Here

Examples of org.more.convert.convert.URIConverter

        this.register(File.class, throwException ? new FileConverter() : new FileConverter(null));
        this.register(java.sql.Date.class, throwException ? new SqlDateConverter() : new SqlDateConverter(null));
        this.register(java.sql.Time.class, throwException ? new SqlTimeConverter() : new SqlTimeConverter(null));
        this.register(Timestamp.class, throwException ? new SqlTimestampConverter() : new SqlTimestampConverter(null));
        this.register(URL.class, throwException ? new URLConverter() : new URLConverter(null));
        this.register(URI.class, throwException ? new URIConverter() : new URIConverter(null));
        this.register(Enum.class, throwException ? new EnumConverter() : new EnumConverter(null));
    }
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.