Example usage for java.net URI getRawSchemeSpecificPart

List of usage examples for java.net URI getRawSchemeSpecificPart

Introduction

In this page you can find the example usage for java.net URI getRawSchemeSpecificPart.

Prototype

public String getRawSchemeSpecificPart() 

Source Link

Document

Returns the raw scheme-specific part of this URI.

Usage

From source file:org.cryptomator.frontend.webdav.mount.LinuxGvfsDavMounter.java

@Override
public WebDavMount mount(URI uri, Map<MountParam, Optional<String>> mountParams) throws CommandFailedException {
    final Script mountScript = Script.fromLines("set -x", "gvfs-mount \"dav:$DAV_SSP\"").addEnv("DAV_SSP",
            uri.getRawSchemeSpecificPart());
    mountScript.execute();/*w  w  w .  j a v  a  2 s .  c  o  m*/
    return new LinuxGvfsDavMount(uri);
}

From source file:org.cryptomator.frontend.webdav.mount.LinuxGvfsWebDavMounter.java

@Override
public WebDavMount mount(URI uri, Map<MountParam, Optional<String>> mountParams) throws CommandFailedException {
    final Script mountScript = Script.fromLines("set -x", "gvfs-mount \"dav:$DAV_SSP\"").addEnv("DAV_SSP",
            uri.getRawSchemeSpecificPart());
    mountScript.execute();//  w w w .  j  a  va 2  s.com
    return new LinuxGvfsWebDavMount(uri);
}

From source file:com.almende.eve.transport.amqp.AmqpTransport.java

@Override
public <T> void send(final URI receiverUri, final String message, final String tag,
        final AsyncCallback<T> callback) throws IOException {
    if (channel != null && channel.isOpen()) {
        final String to = receiverUri.getRawSchemeSpecificPart();
        final String msg = JSONEnvelop.wrapAsString(myId, to, message);
        LOG.warning("Sending '" + msg + "' to:" + to);
        channel.basicPublish("", to, null, msg.getBytes());
    } else {/*from  w  ww. j a v a 2s .co  m*/
        throw new IOException("Amqp transport not connected!");
    }
}

From source file:cn.isif.util_plus.http.client.util.URIBuilder.java

private void digestURI(final URI uri) {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery());
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
}

From source file:com.gistlabs.mechanize.util.apache.URIBuilder.java

private void digestURI(final URI uri) {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery(), Consts.UTF_8);
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
}

From source file:com.android.idtt.http.client.util.URIBuilder.java

private void digestURI(final URI uri) {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery(), Charset.forName(HTTP.UTF_8));
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
}

From source file:com.box.restclientv2.httpclientsupport.HttpClientURIBuilder.java

private void digestURI(final URI uri) throws URISyntaxException {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery(), HttpClientConsts.UTF_8);
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
}

From source file:com.chigix.bio.proxy.buffer.FixedBufferTest.java

License:asdf

@Test
public void testGoogleConnect() {
    System.out.println("BANKAI");
    Socket tmp_socket = null;//from  ww  w.  j a  v  a  2 s  .c om
    try {
        tmp_socket = new Socket("www.google.com", 80);
    } catch (IOException ex) {
        Logger.getLogger(FixedBufferTest.class.getName()).log(Level.SEVERE, null, ex);
    }
    final Socket socket = tmp_socket;
    new Thread() {

        @Override
        public void run() {
            while (true) {
                try {
                    int read;
                    System.out.print(read = socket.getInputStream().read());
                    System.out.print("[" + (char) read + "]");
                    System.out.print(",");
                } catch (IOException ex) {
                    Logger.getLogger(FixedBufferTest.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        }

    }.start();
    try {
        //socket.getOutputStream().write("GET http://www.google.com/ HTTP/1.0\r\nHost: www.google.com\r\nConnection: close\r\n\n".getBytes());
        //URI uri = new URI("/?gfe_rd=cr&ei=F07YVIjKBe_98wfq74LICw");
        URI uri = new URI("/asdfwef?");
        System.out.println(uri.getRawFragment());
        System.out.println(uri.getRawPath());
        System.out.println(uri.getRawQuery());
        System.out.println(uri.getRawSchemeSpecificPart());
        socket.getOutputStream()
                .write(("GET / HTTP/1.0\r\nHost: www.google.com\r\nConnection: close\r\n\r\n").getBytes());
        System.out.println("REQUEST SENT");
    } catch (IOException ex) {
        Logger.getLogger(FixedBufferTest.class.getName()).log(Level.SEVERE, null, ex);
    } catch (URISyntaxException ex) {
        Logger.getLogger(FixedBufferTest.class.getName()).log(Level.SEVERE, null, ex);
    }
    try {
        Thread.sleep(50000);
    } catch (InterruptedException ex) {
        Logger.getLogger(FixedBufferTest.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:org.mcxiaoke.commons.http.util.URIBuilderEx.java

private void digestURI(final URI uri) {
    this.scheme = uri.getScheme();
    this.encodedSchemeSpecificPart = uri.getRawSchemeSpecificPart();
    this.encodedAuthority = uri.getRawAuthority();
    this.host = uri.getHost();
    this.port = uri.getPort();
    this.encodedUserInfo = uri.getRawUserInfo();
    this.userInfo = uri.getUserInfo();
    this.encodedPath = uri.getRawPath();
    this.path = uri.getPath();
    this.encodedQuery = uri.getRawQuery();
    this.queryParams = parseQuery(uri.getRawQuery(), URIUtilsEx.UTF_8);
    this.encodedFragment = uri.getRawFragment();
    this.fragment = uri.getFragment();
}

From source file:com.adaptris.core.jms.VendorImplementationImp.java

public JmsDestination createDestination(String destination, JmsActorConfig c) throws JMSException {
    JmsDestinationImpl jmsDest = new JmsDestinationImpl();
    try {/* w  ww.  j  a va  2s.  co m*/
        URI uri = new URI(destination);
        if (!uri.getScheme().equals("jms")) {
            throw new JMSException("failed to parse [" + destination + "]; doesn't start with 'jms'");
        }
        String[] parts = uri.getRawSchemeSpecificPart().split("\\?");
        String[] typeAndName = parts[0].split(":");
        String type = URLDecoder.decode(typeAndName[0], URI_CHARSET);
        String name = URLDecoder.decode(typeAndName[1], URI_CHARSET);
        jmsDest.destType = JmsDestination.DestinationType.valueOf(type.toUpperCase());

        jmsDest.setDestination(jmsDest.destType.create(this, c, name));

        if (parts.length > 1) {
            Map<String, String> params = URLHelper.queryStringToMap(parts[1], URI_CHARSET);
            jmsDest.setDeliveryMode(params.get(RFC6167_DELIVERY_MODE));
            jmsDest.setPriority(params.get(RFC6167_PRIORITY));
            jmsDest.setTimeToLive(params.get(RFC6167_TIME_TO_LIVE));
            jmsDest.setSubscriptionId(params.get(RFC6167_SUBSCRIPTION_ID));
            jmsDest.setSharedConsumerId(params.get(JMS20_SHARED_CONSUMER_ID));
            jmsDest.setNoLocal(params.get(RFC6167_NO_LOCAL));
            String replyToName = params.get(RFC6167_REPLY_TO_NAME);
            if (!isEmpty(replyToName)) {
                jmsDest.setReplyTo(jmsDest.destType.create(this, c, replyToName));
            }
        }
    } catch (NullPointerException e) {
        throw new JMSException("failed to parse [" + destination + "]; NullPointerException");
    } catch (Exception e) {
        JmsUtils.rethrowJMSException(e);
    }
    return jmsDest;
}