Here you can find the source of loadIndex(File root_)
Parameter | Description |
---|---|
root_ | The file where the index is stored in. |
public static Hashtable loadIndex(File root_) throws IOException
//package com.java2s; /*/*from w ww . j a v a2 s. c om*/ This file is part of WOW! based on AHA! (Adaptive Hypermedia for All) which is free software (GNU General Public License) developed by Paul De Bra - Eindhoven University of Technology and University WOW! is also open source software; */ import java.io.*; import java.util.Hashtable; public class Main { /** * Loads an index (Hashtable) from a file. * @param root_ The file where the index is stored in. * @return The indextable. * @exception IOException If an internal error prevents the file * from being read. */ public static Hashtable loadIndex(File root_, String name) throws IOException { File indexfile = new File(root_, name); Hashtable index = new Hashtable(); if (indexfile.exists()) { LineNumberReader in = new LineNumberReader(new FileReader(indexfile)); while (in.ready()) index.put(in.readLine(), new Long(in.readLine())); in.close(); } return index; } /** * Loads an index (Hashtable) from a file. * @param root_ The file where the index is stored in. * @return The indextable. * @exception IOException If an internal error prevents the file * from being read. */ public static Hashtable loadIndex(File root_) throws IOException { return loadIndex(root_, "index"); } }