public class ProjectFileUtils extends Object implements ResourceBridge
Modifier and Type | Field and Description |
---|---|
static boolean |
interrupt |
Constructor and Description |
---|
ProjectFileUtils(String fileName,
String basePath)
Builds a ProjectFileUtils object, initializing a @link{JClicProject}
|
Modifier and Type | Method and Description |
---|---|
void |
avoidZipLinks(PrintStream ps)
Searchs for links to ".jclic.zip" files in @link{ActiveBox}
and @link{JumpInfo} objects, and redirects it to ".jclic" files
|
void |
avoidZipLinksInElement(Element el,
PrintStream ps)
Searchs for links to ".jclic.zip" files in the given JDOM element.
|
void |
avoidZipLinksInJumpInfo(JumpInfo ji,
PrintStream ps)
Searchs for ".jclic.zip" links in JumpInfo elements, changing it to links
to plain ".jclic" files.
|
void |
displayUrl(String url,
boolean inFrame) |
JComponent |
getComponent() |
String |
getMsg(String key) |
Options |
getOptions() |
InputStream |
getProgressInputStream(InputStream is,
int expectedLength,
String name) |
String |
getRelativeFn(String fName) |
void |
normalizeFileNames(PrintStream ps)
Normalizes the file names of the media bag, restricting it to URL-safe
characters.
|
static void |
processFolder(String sourcePath,
String destPath,
String basePath,
Collection<String> fileList,
PrintStream ps) |
static void |
processRootFolder(String sourcePath,
String destPath,
Collection<String> fileList,
PrintStream ps) |
static void |
processSingleFile(String sourceFile,
String destPath,
Collection<String> fileList,
PrintStream ps) |
static void |
processSingleFile(String sourceFile,
String destPath,
String basePath,
Collection<String> fileList,
PrintStream ps) |
void |
saveTo(String path,
Collection<String> fileList,
PrintStream ps)
Saves the JClic project and all its contents in plain format (not zipped)
into the specified path
|
public ProjectFileUtils(String fileName, String basePath) throws Exception
fileName
- - Relative or absolute path to the ".jclic.zip" file to be
processedbasePath
- - Base path of this project. Relative paths are based on
this one. When null, the parent folder of fileName will be used.Exception
public void normalizeFileNames(PrintStream ps) throws InterruptedException
ps
- - The @link{PrintStream} where progress messages will be
outputed. Can be null.InterruptedException
public void avoidZipLinks(PrintStream ps) throws InterruptedException
ps
- - The @link{PrintStream} where progress messages will be
outputed. Can be null.InterruptedException
public void avoidZipLinksInJumpInfo(JumpInfo ji, PrintStream ps) throws InterruptedException
ji
- - The JumpInfo to scan for linksps
- - The @link{PrintStream} where progress messages will be
outputed. Can be null.InterruptedException
public void avoidZipLinksInElement(Element el, PrintStream ps) throws InterruptedException
el
- - The org.jdom.Element to scan for linksps
- - The @link{PrintStream} where progress messages will be
outputed. Can be null.InterruptedException
public void saveTo(String path, Collection<String> fileList, PrintStream ps) throws Exception, InterruptedException
path
- - The path where the project will be savedps
- - The @link{PrintStream} where progress messages will be
outputed. Can be null.Exception
InterruptedException
public static void processSingleFile(String sourceFile, String destPath, Collection<String> fileList, PrintStream ps) throws Exception, InterruptedException
Exception
InterruptedException
public static void processSingleFile(String sourceFile, String destPath, String basePath, Collection<String> fileList, PrintStream ps) throws Exception, InterruptedException
Exception
InterruptedException
public static void processRootFolder(String sourcePath, String destPath, Collection<String> fileList, PrintStream ps) throws Exception, InterruptedException
Exception
InterruptedException
public static void processFolder(String sourcePath, String destPath, String basePath, Collection<String> fileList, PrintStream ps) throws Exception, InterruptedException
Exception
InterruptedException
public InputStream getProgressInputStream(InputStream is, int expectedLength, String name)
getProgressInputStream
in interface ResourceBridge
public Options getOptions()
getOptions
in interface ResourceBridge
public String getMsg(String key)
getMsg
in interface ResourceBridge
public JComponent getComponent()
getComponent
in interface ResourceBridge
public void displayUrl(String url, boolean inFrame)
displayUrl
in interface ResourceBridge
Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.