Skip to content

Commit

Permalink
Optimize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mccullen committed May 12, 2021
1 parent 934f828 commit 264784b
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 49 deletions.
1 change: 0 additions & 1 deletion src/main/java/icapa/cc/AbstractJdbcWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.apache.log4j.Logger;
import org.apache.uima.UimaContext;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
Expand Down
29 changes: 0 additions & 29 deletions src/main/java/icapa/cc/JdbcWriter.java

This file was deleted.

6 changes: 4 additions & 2 deletions src/main/java/icapa/cc/LocalFileOntologyWriter.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package icapa.cc;

import icapa.cc.AbstractFileOntologyWriter;
import icapa.services.*;
import icapa.services.AnalysisEngine;
import icapa.services.FileOntologyConsumer;
import icapa.services.OntologyConsumer;
import icapa.services.OntologyWriterService;
import org.apache.uima.UimaContext;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/icapa/cc/S3FileOntologyWriter.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
package icapa.cc;

import icapa.cc.AbstractFileOntologyWriter;
import icapa.services.*;
import icapa.services.AnalysisEngine;
import icapa.services.OntologyConsumer;
import icapa.services.OntologyWriterService;
import icapa.services.S3OntologyConsumer;
import org.apache.uima.UimaContext;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;

import java.io.*;
import java.io.IOException;

public class S3FileOntologyWriter extends AbstractFileOntologyWriter {
static public final String PARAM_BUCKET = "Bucket";
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/icapa/cc/XmiLineWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
import org.apache.uima.UimaContext;
import org.apache.uima.analysis_engine.AnalysisEngineProcessException;
import org.apache.uima.cas.CAS;
import org.apache.uima.fit.component.JCasAnnotator_ImplBase;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
import org.xml.sax.SAXException;

import java.io.*;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;

/**
* For each document, write the XMI as a single line to the OutputFile
* */
public class XmiLineWriter extends BaseWriter {
static private final Logger LOGGER = Logger.getLogger(XmiLineWriter.class.getName());

Expand All @@ -36,17 +40,15 @@ public void initialize(UimaContext context) throws ResourceInitializationExcepti
FileWriter fileWriter = new FileWriter(file);
writer = new CSVWriter(fileWriter);
} catch (IOException e) {
e.printStackTrace();
LOGGER.error("Error opening file " + _outputFile, e);
}
}

public void process(JCas jCas) throws AnalysisEngineProcessException {
try {
writeXmi(jCas.getCas());
} catch (IOException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (IOException | SAXException e) {
LOGGER.error("Error writing xmi", e);
}
}

Expand All @@ -70,7 +72,7 @@ public void destroy() {
// Closing will cause the writer to actually do the writing.
writer.close();
} catch (IOException e) {
e.printStackTrace();
LOGGER.error("Error closing xmi writer", e);
}
}
}
2 changes: 0 additions & 2 deletions src/main/java/icapa/cr/DelimiterReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
import icapa.services.DelimiterReaderService;
import org.apache.log4j.Logger;
import org.apache.uima.UimaContext;
import org.apache.uima.collection.CollectionException;
import org.apache.uima.fit.descriptor.ConfigurationParameter;
import org.apache.uima.jcas.JCas;
import org.apache.uima.resource.ResourceInitializationException;
import org.apache.uima.util.Progress;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class DelimiterReader extends AbstractDelimiterReader {
static private final Logger LOGGER = Logger.getLogger(DelimiterReader.class.getName());
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/icapa/cr/S3DelimiterReader.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package icapa.cr;

import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.client.builder.AwsClientBuilder;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.S3Object;
import icapa.Util;
import icapa.services.CollectionReader;
Expand Down

0 comments on commit 264784b

Please sign in to comment.