diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-05-19 12:20:08 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-05-19 12:20:08 +0000 |
commit | 48e55ddbb21e93d76aaa0847a1bb0bd641001459 (patch) | |
tree | 56ece01f5efe81f7fde8ccc02eead30854ad1ba2 /wizards/com/sun/star | |
parent | ec94608a5d468de91d34ff5f66208270d554e26b (diff) |
INTEGRATION: CWS qwizards1 (1.1.2); FILE ADDED
2004/03/12 16:17:01 rpiterman 1.1.2.4: documentation and small implementation-fixes
2004/03/11 12:45:05 rpiterman 1.1.2.3: changed to use FileAccess.connectURLs(folder,filename) static method
2004/03/05 19:11:52 rpiterman 1.1.2.2: Further developement
2004/02/11 17:21:13 rpiterman 1.1.2.1: An Exporter which copies the source file to the destination.
Diffstat (limited to 'wizards/com/sun/star')
-rw-r--r-- | wizards/com/sun/star/wizards/web/export/CopyExporter.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/wizards/com/sun/star/wizards/web/export/CopyExporter.java b/wizards/com/sun/star/wizards/web/export/CopyExporter.java new file mode 100644 index 000000000000..36d1f27493fd --- /dev/null +++ b/wizards/com/sun/star/wizards/web/export/CopyExporter.java @@ -0,0 +1,54 @@ +/* + * Created on 17.10.2003 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package com.sun.star.wizards.web.export; + +import com.sun.star.lang.XMultiServiceFactory; +import com.sun.star.wizards.common.FileAccess; +import com.sun.star.wizards.ui.event.Task; +import com.sun.star.wizards.web.data.CGDocument; + +/** + * @author rpiterman + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class CopyExporter extends AbstractExporter{ + + + /* (non-Javadoc) + * @see com.sun.star.wizards.web.export.Exporter#export(java.lang.Object, java.io.File, com.sun.star.wizards.web.data.CGSettings, com.sun.star.lang.XMultiServiceFactory) + */ + public boolean export(CGDocument source, String target,XMultiServiceFactory xmsf, Task task) { + try { + task.advance(true); + + if (exporter.cp_PageType > 0) { + closeDocument(openDocument(source,xmsf),xmsf); + } + + task.advance(true); + + String newTarget = FileAccess.connectURLs( + FileAccess.getParentDir(target) , source.urlFilename) ; + + boolean b = getFileAccess(xmsf).copy(source.cp_URL, newTarget); + + task.advance(true); + + calcFileSize(source,newTarget,xmsf); + + return b; + + } + catch (Exception ex) { + return false; + } + } + + +} |