Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@
</dependency>

<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20131018</version>
<groupId>com.github.openjson</groupId>
<artifactId>openjson</artifactId>
<version>1.0.11</version>
</dependency>

<dependency>
<groupId>org.htmlparser</groupId>
<artifactId>htmlparser</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import org.archive.resource.Resource;
import org.archive.util.StreamCopy;
import org.json.JSONException;
import com.github.openjson.JSONException;

import com.google.common.io.ByteStreams;
import com.google.common.io.CountingOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.archive.resource.warc.record.DNSResourceFactory;
import org.archive.resource.warc.record.WARCJSONMetaDataResourceFactory;
import org.archive.resource.warc.record.WARCMetaDataResourceFactory;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class ExtractingResourceFactoryMapper implements ResourceFactoryMapper {

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/archive/extract/RealCDXExtractorOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
import org.archive.url.WaybackURLKeyMaker;
import org.archive.util.IAUtils;
import org.archive.util.StreamCopy;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

import com.google.common.io.ByteStreams;
import com.google.common.io.CountingOutputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import org.archive.resource.Resource;
import org.archive.util.IAUtils;
import org.archive.util.StreamCopy;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

import com.google.common.io.ByteStreams;
import com.google.common.io.CountingOutputStream;
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/org/archive/extract/WATExtractorOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.archive.util.DateUtils;
import org.archive.util.StreamCopy;
import org.archive.util.io.CommitedOutputStream;
import org.json.JSONException;
import com.github.openjson.JSONException;

import java.net.InetAddress;
import java.text.DateFormat;
Expand Down Expand Up @@ -169,12 +169,8 @@ private void writeWARCMDRecord(OutputStream recOut, MetaData md,
ByteArrayOutputStream bos = new ByteArrayOutputStream();

OutputStreamWriter osw = new OutputStreamWriter(bos, UTF8);
try {
md.write(osw);
} catch (JSONException e1) {
e1.printStackTrace();
throw new IOException(e1);
}
String contents = md.toString();
osw.write(contents, 0, contents.length());
osw.flush();
// ByteArrayInputStream bais = new ByteArrayInputStream(md.toString().getBytes("UTF-8"));
Date capDate;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/archive/format/arc/FiledescRecord.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.util.logging.Logger;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class FiledescRecord {
private static final Logger LOG =
Expand Down Expand Up @@ -87,4 +87,4 @@ public String getFormat() {
public void setFormat(String format) {
this.format = format;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;

import org.json.JSONObject;
import com.github.openjson.JSONObject;

public class CompoundORJSONPathSpec implements JSONPathSpec {
ArrayList<JSONPathSpec> parts;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/archive/format/json/JSONPathSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.List;

import org.json.JSONObject;
import com.github.openjson.JSONObject;

public interface JSONPathSpec {
public static final String EMPTY = "";
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/archive/format/json/JSONUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import java.util.List;
import java.util.logging.Logger;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class JSONUtils {
private static final Logger LOG =
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/archive/format/json/JSONView.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.logging.Logger;

import org.apache.commons.lang.StringUtils;
import org.json.JSONObject;
import com.github.openjson.JSONObject;

/**
*
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/archive/format/json/SimpleJSONPathSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import java.util.List;
import java.util.logging.Logger;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class SimpleJSONPathSpec implements JSONPathSpec {
private static final Logger LOG =
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/archive/hadoop/ArchiveJSONViewLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.apache.pig.data.Tuple;
import org.apache.pig.data.TupleFactory;
import org.archive.format.json.JSONView;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class ArchiveJSONViewLoader extends ArchiveMetadataLoader {
private final static Logger LOG =
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/archive/hadoop/func/JSONViewEvalFunc.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import org.apache.pig.data.Tuple;
import org.apache.pig.data.TupleFactory;
import org.archive.format.json.JSONUtils;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class JSONViewEvalFunc extends EvalFunc<Tuple> {
private static final Logger LOG =
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/archive/io/WriterPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

/**
* Pool of Writers.
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/archive/resource/MetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import java.util.logging.Logger;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;
import com.github.openjson.JSONTokener;

public class MetaData extends JSONObject {

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/archive/resource/gzip/GZIPMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
import org.archive.resource.MetaData;
import org.archive.resource.ResourceConstants;
import org.archive.util.ByteOp;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class GZIPMetaData extends MetaData implements ResourceConstants {
private static final Logger LOG = Logger.getLogger(GZIPMetaData.class.getName());
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/archive/resource/html/HTMLMetaData.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

import org.archive.resource.MetaData;
import org.archive.resource.ResourceConstants;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class HTMLMetaData extends MetaData implements ResourceConstants {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.archive.resource.ResourceParseException;
import org.htmlparser.lexer.Page;
import org.htmlparser.util.ParserException;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class HTMLResourceFactory implements ResourceFactory {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import org.archive.resource.MetaData;
import org.archive.resource.ResourceConstants;
import org.archive.resource.ResourceContainer;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

public class DNSResource extends AbstractEmptyResource implements ResourceConstants {
private static final Logger LOG =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.archive.resource.ResourceContainer;
import org.archive.resource.ResourceFactory;
import org.archive.resource.ResourceParseException;
import org.json.JSONException;
import org.json.JSONTokener;
import com.github.openjson.JSONException;
import com.github.openjson.JSONTokener;

public class WARCJSONMetaDataResourceFactory implements ResourceFactory, ResourceConstants {
private static final Charset UTF8 = Charset.forName("UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import java.util.ArrayList;

import org.archive.util.TestUtils;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

import junit.framework.TestCase;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.archive.format.json;

import org.archive.util.TestUtils;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

import junit.framework.TestCase;

Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/archive/format/json/JSONViewTest.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.archive.format.json;

import org.archive.util.TestUtils;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

import junit.framework.TestCase;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.archive.format.json;

import org.archive.util.TestUtils;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

import junit.framework.TestCase;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import org.archive.resource.ResourceParseException;
import org.archive.resource.ResourceProducer;
import org.htmlparser.nodes.TextNode;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.Multimap;

Expand Down
6 changes: 3 additions & 3 deletions src/test/java/org/archive/resource/html/HTMLMetaDataTest.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.archive.resource.html;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import com.github.openjson.JSONArray;
import com.github.openjson.JSONException;
import com.github.openjson.JSONObject;

import junit.framework.TestCase;

Expand Down