|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.umd.cfar.lamp.viper.gui.core.LostFileFinder
Since the user shouldn't have to deal with the fact that the viper metadata files and the media files will be stored independently, the need to have a structured way of locating the media files becomes important. What is likely necessary is a user folder with .index files, .project files and the like. How does .ppt handle this? Some lousy hack, no doubt. I really want fs level indexing like bfs, where i can say 'get me the file with the following hash' or something. Damn, that would be cool, and I have to wait until longhorn comes out, and then I still can't use it since I'm trapped in the sandbox. Maybe I just complain too much.
Nested Class Summary | |
static interface |
LostFileFinder.SearchCompleted
Code to run when the search completes or the user has browsed for a file or cancelled the search. |
static class |
LostFileFinder.StoppedFinderException
Thrown when the search thread is interrupted. |
Constructor Summary | |
LostFileFinder()
|
Method Summary | |
static java.io.File |
findTheFile(java.net.URI oldPath,
java.io.File[] paths)
Looks for the local version of the file, first checking the name of the file as absolute path, then using 'which', then by searching the disk. |
static java.io.File[] |
getDefaultSearchPaths()
Gets the default search list: the user directory, the current directory, then all the roots. |
static java.awt.Window |
getSearchDialog(java.net.URI oldURI,
java.io.File[] paths,
LostFileFinder.SearchCompleted whenDone,
java.awt.Frame parent)
Gets a 'Browse for file' dialog box, while starting a search for a file with the same name in the background. |
static java.io.File |
smartFindLocalPath(java.lang.String[] oldPath,
java.util.Set dirs,
java.io.File root,
java.util.Set except)
Searches from root on down for the first file it finds named oldPath[0], and returns the absolute path to same. oldPath, dirs and except are lists or sets of strings or paths that hopefully keep the search somewhat focused. |
static java.io.File |
smartFindLocalPath(java.lang.String oldPath,
java.io.File[] paths)
If which doesn't work, open up a can of whoop-ass on it. |
static java.io.File |
which(java.lang.String fname,
java.io.File[] paths)
Searches all directories specified in the paths variable for the first occurance of the given fname. |
static java.io.File |
which(java.lang.String fname,
java.lang.String paths)
Searches all directories specified in the paths variable for the first occurance of the given fname. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LostFileFinder()
Method Detail |
public static java.io.File which(java.lang.String fname, java.lang.String paths)
fname
- paths
-
public static java.io.File which(java.lang.String fname, java.io.File[] paths)
fname
- paths
-
public static java.io.File smartFindLocalPath(java.lang.String oldPath, java.io.File[] paths)
oldPath
- the path of the old file to look for; used
as a heuristicpaths
- the paths to search beneath
null
if none is found
with the given namepublic static java.io.File[] getDefaultSearchPaths()
public static java.io.File findTheFile(java.net.URI oldPath, java.io.File[] paths)
oldPath
- paths
- roots and which directories
LostFileFinder.StoppedFinderException
- if the thread is interruptedpublic static java.io.File smartFindLocalPath(java.lang.String[] oldPath, java.util.Set dirs, java.io.File root, java.util.Set except)
oldPath
- The path we thought the file had, reversed by path,
like dns (eg /fs/lamp/something.mpg is {"something.mpg", "lamp", "fs"})dirs
- A set (probably a HashSet) containing oldPath[1:]
These are Stringsroot
- The current search root. This searches recursivelyexcept
- Don't look at these absolute paths. These are File objects.
null
if not found.public static java.awt.Window getSearchDialog(java.net.URI oldURI, java.io.File[] paths, LostFileFinder.SearchCompleted whenDone, java.awt.Frame parent)
oldURI
- The file to look forpaths
- Places to checkwhenDone
- Code to run when the file is found or the user
selected it, or hit cancel or it was not foundparent
- The frame to which the dialog should be attached
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |