|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectcopyURL
public class copyURL
A general helper class that reads data form the net...
| Field Summary | |
|---|---|
private static java.lang.String |
amazon1
|
private static java.lang.String |
amazon2
|
private static java.lang.String |
amazon3
|
private static java.lang.String |
amazonAssId
Amazons associate key (Your Access Key ID) used to retrieve book data. |
private static java.lang.String |
isbndb1
|
private static java.lang.String |
isbndb2
|
private static java.lang.String |
isbndbKey
isbndb's key used to retrieve their book metadata. |
| Constructor Summary | |
|---|---|
copyURL()
|
|
| Method Summary | |
|---|---|
static boolean |
findS(java.lang.String xmlFile,
java.lang.String regex)
Attempts to find (not match) the String regex in the file that was downloaded from amazon/isbndb. |
static java.lang.String[] |
getCatagories(java.lang.String xmlFile)
Gets the categories of the book from the books xml file downloaded from amazon. |
static java.lang.String |
getFile(java.lang.String amazonXMLPath,
java.lang.String fileType,
java.lang.String isbn,
java.lang.String xmlName,
java.lang.String responseGrp,
java.lang.String isbndbResults,
boolean isbndb)
This takes an ISBN number and attempts to get from amazon or isbndb its corresponding xml file. |
static int |
getNumberOfFiles(java.io.File dir,
java.io.File[] fileList,
int listPosition)
Given directory dir, this calculates the total number of files in it including files in its sub-directories but doesn't count the directories themselves. |
static java.lang.String |
getTitle(java.lang.String xmlFile)
Gets the title of the book from the books xml file downloaded from amazon. |
static void |
printAllFiles(java.io.File[] fileList,
java.lang.String resultPath)
Prints and saves a text file with all the file names in fileList. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String amazonAssId
private static final java.lang.String amazon1
private static final java.lang.String amazon2
private static final java.lang.String amazon3
private static final java.lang.String isbndbKey
private static final java.lang.String isbndb1
private static final java.lang.String isbndb2
| Constructor Detail |
|---|
public copyURL()
| Method Detail |
|---|
public static java.lang.String getFile(java.lang.String amazonXMLPath,
java.lang.String fileType,
java.lang.String isbn,
java.lang.String xmlName,
java.lang.String responseGrp,
java.lang.String isbndbResults,
boolean isbndb)
amazonXMLPath - The full path of the directory where the downloaded temp files are stored.fileType - The file type in which to save the downloaded metadata, usually just "txt".isbn - The ISBN number without "-", just the number.xmlName - The name of the file to which the downloaded data will be saved to. "TempFile" works.responseGrp - Amazons response group, usually "Small".isbndbResults - isbndb's results/response group, usually "details".isbndb - Whether to get the data from amazon or from isbndb. If true it only get it from isbndb, if false only from amazon.
public static java.lang.String[] getCatagories(java.lang.String xmlFile)
xmlFile - The full path and filename of the xml file that was downloaded/gotten/saved from amazon/isbndb.
public static java.lang.String getTitle(java.lang.String xmlFile)
xmlFile - The full path and filename of the xml file that was downloaded/gotten/saved from amazon/isbndb.
public static boolean findS(java.lang.String xmlFile,
java.lang.String regex)
xmlFile - The full path and filename of the xml file that was downloaded/gotten/saved from amazon/isbndb.findIt - the String regex to be found in the file.
public static int getNumberOfFiles(java.io.File dir,
java.io.File[] fileList,
int listPosition)
dir - The directory where the files are present.fileList - a File[] with size at least as big as the probable total number of files in the directory. But it should not contain anything yet.listPosition - Where in fileList to add the next file. It's used to keep track because this is recursive. When calling this method it should be 0, unless you want to start later in the array.
public static void printAllFiles(java.io.File[] fileList,
java.lang.String resultPath)
fileList - The fileList containing all the files.resultPath - The full path and filename for the text file to which the file list will be saved to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||