Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.File;

public class Main {
    /**
     * Tests if the directory contains the essential root file for a Daisy book
     * 
     * Currently it's limited to checking for Daisy 2.02 books.
     * @param folder for the directory to check
     * @return true if the directory is deemed to contain a Daisy Book, else
     * false.
     */
    public static boolean folderContainsDaisy2_02Book(File folder) {
        if (!folder.isDirectory()) {
            return false;
        }

        if (new File(folder, "ncc.html").exists()) {
            return true;
        }

        // Minor hack to cope with the potential of ALL CAPS filename, as per
        // http://www.daisy.org/z3986/specifications/daisy_202.html#ncc
        if (new File(folder, "NCC.HTML").exists()) {
            return true;
        }

        return false;
    }
}