Examples of DownloadURLConnector


Examples of org.spout.downpour.connector.DownloadURLConnector

  private CallbackTask getImage(final String user) {
    return new CallbackTask(new Callable<BufferedImage>() {
      public BufferedImage call() throws Exception {
        try {
          System.out.println("Attempting to grab avatar helm for " + user + "...");
          InputStream stream = RestAPI.getCache().get(new URL("https://minotar.net/helm/" + user + "/100"), new DownloadURLConnector() {
            @Override
            public void setHeaders(URLConnection conn) {
              conn.setDoInput(true);
              conn.setDoOutput(false);
              System.setProperty("http.agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19");
View Full Code Here

Examples of org.spout.downpour.connector.DownloadURLConnector

  public void run() {
    ReadableByteChannel rbc = null;
    FileOutputStream fos = null;
    try {
      DownpourCache cache = RestAPI.getCache();
      InputStream in = cache.get(url, new DownloadURLConnector() {
        @Override
        public void setHeaders(URLConnection conn) {
          conn.setDoInput(true);
          conn.setDoOutput(false);
          System.setProperty("http.agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19");
View Full Code Here

Examples of org.spout.downpour.connector.DownloadURLConnector

        // Setup url
        URL url = new URL(this.url);

        // Copy file
        stream = RestAPI.getCache().get(url, new DownloadURLConnector() {
          @Override
          public void setHeaders(URLConnection conn) {
            conn.setDoInput(true);
            conn.setDoOutput(false);
            System.setProperty("http.agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.162 Safari/535.19");
View Full Code Here

Examples of org.spout.downpour.connector.DownloadURLConnector

  public static String getMD5URL(String md5) {
    return REST_URL + "hash/" + md5;
  }

  public static InputStream getCachingInputStream(URL url, boolean force) throws NoCacheException, IOException {
    return cache.get(url, force ? new DownloadURLConnector() : new DefaultURLConnector(), force);
  }
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.