Skip to content

Commit

Permalink
Add packages, code, tests and test resources
Browse files Browse the repository at this point in the history
Note: Could not include SRR390728_1.fq and
experiment/fastq_data/SRR390728_2.fq because of github size restriction.
  • Loading branch information
aaiezza committed Nov 6, 2015
1 parent 39bc3e0 commit fe83597
Show file tree
Hide file tree
Showing 65 changed files with 69,793 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="launch4j_configs/" kind="src" path="resources"/>
<classpathentry kind="src" path="resources"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="src" path="test_resources"/>
<classpathentry exported="true" kind="con" path="org.springsource.ide.eclipse.gradle.classpathcontainer"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_45">
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_65">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.fq filter=lfs diff=lfs merge=lfs -text
90 changes: 90 additions & 0 deletions src/edu/rit/flick/AbstractFlickFile.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/**
* COPYRIGHT (C) 2015 Alex Aiezza. All Rights Reserved.
*
* See the LICENSE for the specific language governing permissions and
* limitations under the License provided with this project.
*/
package edu.rit.flick;

import static edu.rit.flick.config.DefaultOptionSet.ARCHIVE_MODE;
import static edu.rit.flick.config.DefaultOptionSet.INPUT_PATH;
import static edu.rit.flick.config.DefaultOptionSet.OUTPUT_PATH;

import java.io.File;

import net.lingala.zip4j.core.ZipFile;
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.model.ZipParameters;
import net.lingala.zip4j.util.Zip4jConstants;

import org.apache.commons.io.FileUtils;

import edu.rit.flick.config.Configuration;

/**
* @author Alex Aiezza
*
*/
public abstract class AbstractFlickFile implements FlickFile
{
private final File fileIn, fileOut;

protected final Configuration configuration;

protected final ZipFile flickFile;

protected final ZipParameters zParams;

public AbstractFlickFile( final Configuration configuration ) throws ZipException
{
this.configuration = configuration;

final String inputPath = (String) configuration.getOption( INPUT_PATH );
final Object outputPath = configuration.getOption( OUTPUT_PATH );

fileIn = new File( inputPath );
fileOut = new File( outputPath == null ? fileIn.getPath() + getDefaultDeflatedExtension()
: (String) outputPath );

if ( fileOut.exists() )
FileUtils.deleteQuietly( fileOut );

flickFile = new ZipFile( configuration.getFlag( ARCHIVE_MODE ) ? fileOut : fileIn );

zParams = new ZipParameters();

zParams.setIncludeRootFolder( true );
zParams.setCompressionMethod( Zip4jConstants.COMP_DEFLATE );
zParams.setCompressionLevel( Zip4jConstants.DEFLATE_LEVEL_FAST );
}

@Override
public Configuration getConfiguration()
{
return configuration;
}

@Override
public File getFileIn()
{
return fileIn;
}

@Override
public String getFileInPath()
{
return fileIn.getPath();
}

@Override
public File getFileOut()
{
return fileOut;
}

@Override
public String getFileOutPath()
{
return fileOut.getPath();
}
}
Loading

0 comments on commit fe83597

Please sign in to comment.