Skip to content
Snippets Groups Projects
Commit 8d440310 authored by tpylak's avatar tpylak
Browse files

SE-242 remove unused classes

SVN: 15720
parent ef7516b3
No related branches found
No related tags found
No related merge requests found
......@@ -17,10 +17,12 @@
package ch.systemsx.cisd.openbis.metadata;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.Charset;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
......@@ -34,7 +36,7 @@ import com.csvreader.CsvReader;
*/
public class ImageAnalysisLMCSplitter
{
private static final String SEPARATOR = ",";
private static final char SEPARATOR = ',';
public static void main(String[] args) throws FileNotFoundException, IOException
{
......@@ -44,13 +46,34 @@ public class ImageAnalysisLMCSplitter
.println("There should be exactly one parameter: <image-analysis-results-file-path>");
return;
}
CsvReader reader = ScreeningLibraryTransformer.readFile(args[0]);
CsvReader reader = readFile(args[0]);
boolean ok = reader.readRecord();
assert ok;
String[] header = reader.getValues();
splitPlates(reader, header);
}
private static CsvReader readFile(String path) throws FileNotFoundException, IOException
{
File file = new File(path);
if (file.isFile() == false)
{
error(file + " does not exist or is not a file.");
}
FileInputStream fileInputStream = new FileInputStream(file);
CsvReader csvReader = new CsvReader(fileInputStream, Charset.defaultCharset());
csvReader.setDelimiter(SEPARATOR);
csvReader.setSafetySwitch(false);
return csvReader;
}
private static void error(String msg)
{
System.err.println(msg);
System.exit(1);
}
private static void splitPlates(CsvReader reader, String[] header) throws IOException,
FileNotFoundException
{
......
/*
* Copyright 2010 ETH Zuerich, CISD
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package ch.systemsx.cisd.openbis.metadata;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.charset.Charset;
import com.csvreader.CsvReader;
/**
* Transforms a screening library file and produces files which can be uploaded to openBIS: genes,
* oligos and plates with wells.
*
* @author Tomasz Pylak
*/
public class ScreeningLibraryTransformer
{
private final static char SEPARATOR = ',';
static CsvReader readFile(String path) throws FileNotFoundException, IOException
{
File file = new File(path);
if (file.isFile() == false)
{
error(file + " does not exist or is not a file.");
}
FileInputStream fileInputStream = new FileInputStream(file);
CsvReader csvReader = new CsvReader(fileInputStream, Charset.defaultCharset());
csvReader.setDelimiter(SEPARATOR);
csvReader.setSafetySwitch(false);
return csvReader;
}
private static void error(String msg)
{
System.err.println(msg);
System.exit(1);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment