Skip to content

Commit 1e06b7c

Browse files
author
Achim Brandt
committed
deleted unused imports
1 parent 56208b9 commit 1e06b7c

File tree

2 files changed

+42
-40
lines changed

2 files changed

+42
-40
lines changed

src/test/java/com/arangodb/sandbox/ImportNico2Video.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
import java.io.BufferedReader;
2020
import java.io.File;
2121
import java.io.FileInputStream;
22-
import java.io.FileNotFoundException;
2322
import java.io.IOException;
2423
import java.io.InputStreamReader;
25-
import java.io.UnsupportedEncodingException;
2624
import java.util.zip.GZIPInputStream;
2725

2826
import com.arangodb.ArangoClient;
@@ -35,20 +33,21 @@
3533
*
3634
*/
3735
public class ImportNico2Video {
38-
39-
public static void main(String[] args) throws ArangoException, IllegalArgumentException, IOException {
40-
41-
ArangoConfigure configure = new ArangoConfigure();
42-
configure.init();
43-
44-
ArangoClient client = new ArangoClient(configure);
45-
46-
File file = new File("0000.dat.gz");
47-
LineIterator itr = new LineIterator(new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(file)), "utf-8")));
48-
client.importRawJsonDocuments("nico", true, itr, 10);
49-
LineIterator.closeQuietly(itr);
50-
configure.shutdown();
51-
52-
}
53-
36+
37+
public static void main(String[] args) throws ArangoException, IllegalArgumentException, IOException {
38+
39+
ArangoConfigure configure = new ArangoConfigure();
40+
configure.init();
41+
42+
ArangoClient client = new ArangoClient(configure);
43+
44+
File file = new File("0000.dat.gz");
45+
LineIterator itr = new LineIterator(
46+
new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(file)), "utf-8")));
47+
client.importRawJsonDocuments("nico", true, itr, 10);
48+
LineIterator.closeQuietly(itr);
49+
configure.shutdown();
50+
51+
}
52+
5453
}

src/test/java/com/arangodb/sandbox/PostChunkTest.java

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,36 +19,39 @@
1919
import java.io.ByteArrayInputStream;
2020

2121
import org.apache.http.HttpResponse;
22-
import org.apache.http.client.HttpClient;
2322
import org.apache.http.client.methods.HttpPost;
2423
import org.apache.http.entity.InputStreamEntity;
25-
import org.apache.http.entity.StringEntity;
26-
import org.apache.http.impl.client.DefaultHttpClient;
24+
import org.apache.http.impl.client.CloseableHttpClient;
25+
import org.apache.http.impl.client.HttpClientBuilder;
2726

2827
/**
2928
* @author tamtam180 - kirscheless at gmail.com
3029
*
3130
*/
3231
public class PostChunkTest {
3332

34-
/**
35-
* @param args
36-
*/
37-
public static void main(String[] args) throws Exception {
38-
39-
HttpClient client = new DefaultHttpClient();
40-
41-
HttpPost post = new HttpPost("http://arango-test-server:9999/_api/import?collection=test1&createCollection=true&type=documents");
42-
//post.setEntity(new StringEntity("{\"xx\": \"123\"}{\"xx\": \"456\"}"));
43-
InputStreamEntity entity = new InputStreamEntity(new ByteArrayInputStream("{\"xx\": \"123\"}{\"xx\": \"456\"}".getBytes()), 26);
44-
entity.setChunked(true);
45-
post.setEntity(entity);
46-
47-
HttpResponse res = client.execute(post);
48-
49-
System.out.println(res.getStatusLine());
50-
51-
post.releaseConnection();
52-
}
33+
/**
34+
* @param args
35+
*/
36+
public static void main(String[] args) throws Exception {
37+
38+
HttpClientBuilder builder = HttpClientBuilder.create();
39+
CloseableHttpClient client = builder.build();
40+
41+
HttpPost post = new HttpPost(
42+
"http://localhost:8529/_api/import?collection=test1&createCollection=true&type=documents");
43+
// post.setEntity(new StringEntity("{\"xx\": \"123\"}{\"xx\":
44+
// \"456\"}"));
45+
InputStreamEntity entity = new InputStreamEntity(
46+
new ByteArrayInputStream("{\"xx\": \"123\"}{\"xx\": \"456\"}".getBytes()), 26);
47+
entity.setChunked(true);
48+
post.setEntity(entity);
49+
50+
HttpResponse res = client.execute(post);
51+
52+
System.out.println(res.getStatusLine());
53+
54+
post.releaseConnection();
55+
}
5356

5457
}

0 commit comments

Comments
 (0)