- All Implemented Interfaces:
Runnable
,Future<Integer>
,RunnableFuture<Integer>
This class generates a set of HTML pages that allows a user to browse groups
of pictures in a web-browser. The resulting html pages can be posted to the
Internet. Relative addressing has been used throughout.
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.SwingWorker
SwingWorker.StateValue
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
cleanupFilename
(String string) Translates characters which are problematic in a filename into unproblematic charactersprotected Integer
Entry point for the SwingWorker when execute() is called.protected void
done()
SwingWorker calls here when the background task is done.static WebsiteGenerator
generateWebsite
(GenerateWebsiteRequest request) static void
static int
getEndIndex
(int startIndex, int childCount, int indexPerRow) static @NotNull com.jcraft.jsch.Session
getSshSession
(com.jcraft.jsch.JSch jsch, GenerateWebsiteRequest request) static int
getStartIndex
(int childNumber, int indexPerRow) protected void
This method is called by SwingWorker when the background process sends a publish event.static void
Write the jpo.css file to the target directory.static void
writeFileFromJar
(String file, File targetDirectory, List<File> websiteMemberFiles) Write the specified file from the classloader to the target directory.static void
writeFolderIconTest
(GenerateWebsiteRequest request, List<File> files) static void
writeJpoJs
(File targetDirectory, List<File> websiteMemberFiles) Write the jpo.js file to the target directory.void
writeLowresGroup
(SortableDefaultMutableTreeNode groupNode) This method writes out an HTML page with the small images aligned next to each other.static void
writeRobotsTxt
(File targetDirectory, List<File> websiteMemberFiles) Write the robots.txt file to the target directory.Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, publish, removePropertyChangeListener, run, setProgress
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.concurrent.Future
exceptionNow, resultNow, state
-
Field Details
-
JPO_JS
- See Also:
-
A_HREF
- See Also:
-
FOLDER_ICON
- See Also:
-
-
Method Details
-
generateWebsite
-
cleanupFilename
Translates characters which are problematic in a filename into unproblematic characters- Parameters:
string
- The filename to clean up- Returns:
- The cleaned up filename
-
writeCss
Write the jpo.css file to the target directory.- Parameters:
targetDirectory
- The directory to write to
-
writeRobotsTxt
Write the robots.txt file to the target directory.- Parameters:
targetDirectory
- The directory to write to
-
writeJpoJs
Write the jpo.js file to the target directory.- Parameters:
targetDirectory
- The directory to write towebsiteMemberFiles
- A reference to the list of files where we shall add our entry.
-
writeFileFromJar
public static void writeFileFromJar(String file, File targetDirectory, List<File> websiteMemberFiles) Write the specified file from the classloader to the target directory.- Parameters:
file
- the file to copy from the classloadertargetDirectory
- The directory to write towebsiteMemberFiles
- A reference to the list of files where we shall add our entry.
-
writeFolderIconTest
@TestOnly public static void writeFolderIconTest(GenerateWebsiteRequest request, List<File> files) throws IOException - Throws:
IOException
-
generateZipfileTest
-
doInBackground
Entry point for the SwingWorker when execute() is called.- Specified by:
doInBackground
in classSwingWorker<Integer,
String> - Returns:
- an Integer (not sure what to do with this...)
- Throws:
Exception
- hopefully not
-
process
This method is called by SwingWorker when the background process sends a publish event.- Overrides:
process
in classSwingWorker<Integer,
String> - Parameters:
messages
- A message that will be written to the logfile.
-
done
protected void done()SwingWorker calls here when the background task is done.- Overrides:
done
in classSwingWorker<Integer,
String>
-
writeLowresGroup
This method writes out an HTML page with the small images aligned next to each other. Each Group and picture is created in an html file called jpo_1234.htm except for the first one that gets named index.htm. 1234 is the internal hashCode of the node so that we can translate parents and children to each other.- Parameters:
groupNode
- The node at which the extraction is to start.
-
getStartIndex
public static int getStartIndex(int childNumber, int indexPerRow) -
getEndIndex
public static int getEndIndex(int startIndex, int childCount, int indexPerRow) -
getSshSession
@NotNull public static @NotNull com.jcraft.jsch.Session getSshSession(com.jcraft.jsch.JSch jsch, GenerateWebsiteRequest request) throws com.jcraft.jsch.JSchException - Throws:
com.jcraft.jsch.JSchException
-