if (line.trim().startsWith("-r ")) {        String sRegistrationLine = line.trim(); int iAssetstore = -1; String sFilePath = null; String sBundle = null; StringTokenizer tokenizer = new StringTokenizer(sRegistrationLine); while (tokenizer.hasMoreTokens()) { String sToken = tokenizer.nextToken(); if (sToken.equals("-r")) { continue; } else if (sToken.equals("-s") && tokenizer.hasMoreTokens()) { try { iAssetstore = Integer.parseInt(tokenizer.nextToken()); } catch (NumberFormatException e) {  } } else if (sToken.equals("-f") && tokenizer.hasMoreTokens()) { sFilePath = tokenizer.nextToken();  } else if (sToken.startsWith("bundle:")) { sBundle = sToken.substring(7); } else {  } } if (iAssetstore == -1 || sFilePath == null) { System.out.println("\tERROR: invalid contents file line"); System.out.println("\t\tSkipping line: " + sRegistrationLine); continue; } registerBitstream(c, i, iAssetstore, sFilePath, sBundle); System.out.println("\tRegistering Bitstream: " + sFilePath + "\tAssetstore: " + iAssetstore + "\tBundle: " + sBundle); continue; }
    private void processContentsFile(Context c, Item i, String path,            String filename) throws SQLException, IOException,            AuthorizeException    {        String contentspath = path + File.separatorChar + filename;        String line = "";        System.out.println("\tProcessing contents file: " + contentspath);        BufferedReader is = null;        try        {            is = new BufferedReader(new FileReader(contentspath));            while ((line = is.readLine()) != null)            {                if ("".equals(line.trim()))                {                    continue;                }                // look for a bundle name                String bundleMarker = "\tbundle:";                int markerIndex = line.indexOf(bundleMarker);                if (markerIndex == -1)                {                    // no bundle found                    processContentFileEntry(c, i, path, line, null);                    System.out.println("\tBitstream: " + line);                }                else                {                    // found bundle                    String bundleName = line.substring(markerIndex                            + bundleMarker.length());                    String bitstreamName = line.substring(0, markerIndex);                    processContentFileEntry(c, i, path, bitstreamName,                            bundleName);                    System.out.println("\tBitstream: " + bitstreamName                            + "\tBundle: " + bundleName);                }            }        }        finally        {            if (is != null)            {                is.close();            }        }    }