Package org.carrot2.util.httpclient

Examples of org.carrot2.util.httpclient.HttpUtils$Response


   /**
    * Returns whether the given node exists.
    */
   public boolean exists(Fqn name) throws Exception
   {
      Response response = connection.head(getBucket(), key(name));
      if (trace)
      {
         log.trace("exists " + name + " response=" + response);
      }
      return response.isOk();
   }
View Full Code Here


      put0(name, wrap(map));
   }

   private void put0(Fqn name, S3Object obj) throws Exception
   {
      Response response = connection.put(getBucket(), key(name), obj);
      if (trace)
      {
         log.trace("put " + name + " obj=" + obj + " response=" + response);
      }
      ensureParent(name);
      if (!response.isOk())
         throw new S3Exception("Put failed " + response);
   }
View Full Code Here

         for (String child : children)
         {
            remove(Fqn.fromRelativeElements(name, child));
         }
      }
      Response response = connection.delete(getBucket(), key(name));
      if (trace)
      {
         log.trace("delete " + name + " response=" + response);
      }
      if (!response.isOk() && !response.isNotFound())
         throw new S3Exception("delete failed " + response);
      parents.remove(name);
   }
View Full Code Here

   {
      log.debug("Starting");
      try
      {
         this.connection = config.getConnection();
         Response create = connection.create(getBucket(), config.getLocation());
         if (!create.isOk())
            throw new S3Exception("Unable to create bucket: " + create);
         log.info("S3 accessed successfully. Bucket created: " + create);
      }
      catch (Exception e)
      {
View Full Code Here

   {
      log.debug("Starting");
      try
      {
         this.connection = config.getConnection();
         Response create = connection.create(getBucket(), config.getLocation());
         if (!create.isOk())
            throw new S3Exception("Unable to create bucket: " + create);
         log.info("S3 accessed successfully. Bucket created: " + create);
      }
      catch (Exception e)
      {
View Full Code Here

   /**
    * Returns whether the given node exists.
    */
   public boolean exists(Fqn name) throws Exception
   {
      Response response = connection.head(getBucket(), key(name));
      if (trace)
      {
         log.trace("exists " + name + " response=" + response);
      }
      return response.isOk();
   }
View Full Code Here

      put0(name, wrap(map));
   }

   private void put0(Fqn name, S3Object obj) throws Exception
   {
      Response response = connection.put(getBucket(), key(name), obj);
      if (trace)
      {
         log.trace("put " + name + " obj=" + obj + " response=" + response);
      }
      ensureParent(name);
      if (!response.isOk())
         throw new S3Exception("Put failed " + response);
   }
View Full Code Here

         for (String child : children)
         {
            remove(Fqn.fromRelativeElements(name, child));
         }
      }
      Response response = connection.delete(getBucket(), key(name));
      if (trace)
      {
         log.trace("delete " + name + " response=" + response);
      }
      if (!response.isOk() && !response.isNotFound())
         throw new S3Exception("delete failed " + response);
      parents.remove(name);
   }
View Full Code Here

        .getLexicalData(LanguageCode.MALTESE);

    for (String word : wordsToCheck.split(",")) {
      if (!lexicalData.isCommonWord(new MutableCharArray(word))
          && !lexicalData.isStopLabel(word)) {
        clusters.add(new Cluster(word));
      }
    }
  }
View Full Code Here

  @Test
  public void testSimple() throws Exception {
    //<start id="crt2.simple"/>
    //... setup some documents elsewhere
    final Controller controller =
            ControllerFactory.createSimple();//<co id="crt2.controller.creation"/>
    documents = new ArrayList<Document>();
    for (int i = 0; i < titles.length; i++) {
      Document doc = new Document(titles[i], snippets[i],
              "file://foo_" + i + ".txt");
      documents.add(doc);
    }
    final ProcessingResult result = controller.process(documents,
            "red fox",
            LingoClusteringAlgorithm.class);//<co id="crt2.process"/>
    displayResults(result);//<co id="crt2.print"/>

    /*
 
View Full Code Here

TOP

Related Classes of org.carrot2.util.httpclient.HttpUtils$Response

Copyright © 2018 www.massapicom. 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.