// Path: src/libra/distancematrix/common/DistanceMatrixConstants.java
// public class DistanceMatrixConstants {
//     public final static String KMER_SIMILARITY_FILE_MAPPING_TABLE_FILENAME = "file_mapping_table.json";
//     public final static String KMER_SIMILARITY_RESULT_FILENAME_PREFIX = "result";
//     public final static String KMER_SIMILARITY_RESULT_FILENAME_EXTENSION = "score";
// }
// 
// Path: src/libra/distancematrix/common/kmersimilarity/KmerSimilarityResultPartPathFilter.java
// public class KmerSimilarityResultPartPathFilter implements PathFilter {
// 
//     @Override
//     public boolean accept(Path path) {
//         return KmerSimilarityHelper.isKmerSimilarityResultPartFile(path);
//     }
// }


import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import libra.distancematrix.common.DistanceMatrixConstants;
import libra.distancematrix.common.kmersimilarity.KmerSimilarityResultPartPathFilter;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
        }
        return false;
    }
    
    public static boolean isKmerSimilarityResultPartFile(Path path) {
        return KmerSimilarityHelper.isKmerSimilarityResultPartFile(path.getName());
    }
    
    public static boolean isKmerSimilarityResultPartFile(String path) {
        Matcher matcher = KMER_SIMILARITY_RESULT_PART_PATH_PATTERN.matcher(path.toLowerCase());
        if(matcher.matches()) {
            return true;
        }
        return false;
    }
    
    public static String makeKmerSimilarityFileMappingTableFileName() {
        return DistanceMatrixConstants.KMER_SIMILARITY_FILE_MAPPING_TABLE_FILENAME;
    }
    
    public static String makeKmerSimilarityResultPartFileName(int mapreduceID) {
        return DistanceMatrixConstants.KMER_SIMILARITY_RESULT_FILENAME_PREFIX + "." + DistanceMatrixConstants.KMER_SIMILARITY_RESULT_FILENAME_EXTENSION + "." + mapreduceID;
    }
    
    public static String makeKmerSimilarityResultFileName() {
        return DistanceMatrixConstants.KMER_SIMILARITY_RESULT_FILENAME_PREFIX + "." + DistanceMatrixConstants.KMER_SIMILARITY_RESULT_FILENAME_EXTENSION;
    }
    
    public static Path[] getKmerSimilarityResultPartFilePath(Configuration conf, Path inputPath) throws IOException {
        List<Path> inputFiles = new ArrayList<Path>();
// Path: src/libra/distancematrix/common/DistanceMatrixConstants.java
// public class DistanceMatrixConstants {
//     public final static String KMER_SIMILARITY_FILE_MAPPING_TABLE_FILENAME = "file_mapping_table.json";
//     public final static String KMER_SIMILARITY_RESULT_FILENAME_PREFIX = "result";
//     public final static String KMER_SIMILARITY_RESULT_FILENAME_EXTENSION = "score";
// }
// 
// Path: src/libra/distancematrix/common/kmersimilarity/KmerSimilarityResultPartPathFilter.java
// public class KmerSimilarityResultPartPathFilter implements PathFilter {
// 
//     @Override
//     public boolean accept(Path path) {
//         return KmerSimilarityHelper.isKmerSimilarityResultPartFile(path);
//     }
// }


// Path: src/libra/distancematrix/common/helpers/KmerSimilarityHelper.java
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import libra.distancematrix.common.DistanceMatrixConstants;
import libra.distancematrix.common.kmersimilarity.KmerSimilarityResultPartPathFilter;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

        }
        return false;
    }
    
    public static boolean isKmerSimilarityResultPartFile(Path path) {
        return KmerSimilarityHelper.isKmerSimilarityResultPartFile(path.getName());
    }
    
    public static boolean isKmerSimilarityResultPartFile(String path) {
        Matcher matcher = KMER_SIMILARITY_RESULT_PART_PATH_PATTERN.matcher(path.toLowerCase());
        if(matcher.matches()) {
            return true;
        }
        return false;
    }
    
    public static String makeKmerSimilarityFileMappingTableFileName() {
        return DistanceMatrixConstants.KMER_SIMILARITY_FILE_MAPPING_TABLE_FILENAME;
    }
    
    public static String makeKmerSimilarityResultPartFileName(int mapreduceID) {
        return DistanceMatrixConstants.KMER_SIMILARITY_RESULT_FILENAME_PREFIX + "." + DistanceMatrixConstants.KMER_SIMILARITY_RESULT_FILENAME_EXTENSION + "." + mapreduceID;
    }
    
    public static String makeKmerSimilarityResultFileName() {
        return DistanceMatrixConstants.KMER_SIMILARITY_RESULT_FILENAME_PREFIX + "." + DistanceMatrixConstants.KMER_SIMILARITY_RESULT_FILENAME_EXTENSION;
    }
    
    public static Path[] getKmerSimilarityResultPartFilePath(Configuration conf, Path inputPath) throws IOException {
        List<Path> inputFiles = new ArrayList<Path>();
        KmerSimilarityResultPartPathFilter filter = new KmerSimilarityResultPartPathFilter();