diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2010-01-26 13:09:27 +0100 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2010-01-26 13:09:27 +0100 |
commit | a4229b5076bf1437915aef8361535018753df415 (patch) | |
tree | c6a06823c55b4d79d214fd1d4e3ebc1d917aef8a | |
parent | 6251c88fa1388fbd93c96e4746c6d006240d7702 (diff) | |
parent | 2c11e599eab500c58358b78039aad7c6b1eec6c0 (diff) |
CWS-TOOLING: integrate CWS kso42ooo/DEV300_m71
-rw-r--r-- | odk/examples/DevelopersGuide/UCB/ResourceCreator.java | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/odk/examples/DevelopersGuide/UCB/ResourceCreator.java b/odk/examples/DevelopersGuide/UCB/ResourceCreator.java index 0b12b31d..c28bc47e 100644 --- a/odk/examples/DevelopersGuide/UCB/ResourceCreator.java +++ b/odk/examples/DevelopersGuide/UCB/ResourceCreator.java @@ -8,7 +8,7 @@ * * The Contents of this file are made available subject to the terms of * the BSD license. - * + * * Copyright (c) 2003 by Sun Microsystems, Inc. * All rights reserved. * @@ -35,7 +35,7 @@ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * *************************************************************************/ import com.sun.star.beans.PropertyValue; @@ -43,7 +43,6 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.ucb.ContentInfo; import com.sun.star.ucb.InsertCommandArgument; import com.sun.star.ucb.XContent; -import com.sun.star.ucb.XContentCreator; import com.sun.star.io.XInputStream; @@ -154,18 +153,17 @@ public class ResourceCreator { boolean result = false; if ( stream != null && name != null && !name.equals( "" )) { - // Obtain content creator interface. - XContentCreator creator = ( XContentCreator )UnoRuntime.queryInterface( - XContentCreator.class, m_content ); - - // Note: The data for info may have been obtained using - // XContentCreator::queryCreatableContentsInfo(). + // Note: The data for info may have been obtained from + // property CreatableContentsInfo. ContentInfo info = new ContentInfo(); info.Type = "application/vnd.sun.staroffice.fsys-file"; info.Attributes = 0; - // Create new, empty content. - XContent newContent = creator.createNewContent( info ); + // Create new, empty content (execute command "createNewContent"). + XContent newContent = ( XContent )UnoRuntime.queryInterface( + XContent.class, + m_helper.executeCommand( m_content, "createNewContent", info ) ); + if ( newContent != null ) { ///////////////////////////////////////////////////////////////////// @@ -181,7 +179,7 @@ public class ResourceCreator { props[ 0 ] = prop; // Execute command "setPropertyValues". - m_helper.executeCommand( newContent, "setPropertyValues",props ); + m_helper.executeCommand( newContent, "setPropertyValues", props ); ///////////////////////////////////////////////////////////////////// // Write the new file to disk... @@ -241,7 +239,7 @@ public class ResourceCreator { String workdir = ""; for ( int i = 0; i < args.length; i++ ) { - if ( args[i].startsWith( "-url=" )) { + if ( args[i].startsWith( "-url=" )) { m_contenturl = args[i].substring( 5 ); } else if ( args[i].startsWith( "-name=" )) { m_name = args[i].substring( 6 ); |