diff options
author | Kai Sommerfeld <kso@openoffice.org> | 2010-01-06 16:46:36 +0100 |
---|---|---|
committer | Kai Sommerfeld <kso@openoffice.org> | 2010-01-06 16:46:36 +0100 |
commit | f7fab85572c59895588405b9c0e9f285c1d7aebd (patch) | |
tree | 89a2e1051d10f8484920a4387e1dbec518d5f097 /odk/examples/DevelopersGuide | |
parent | b2b8880f39c7a5ba366e486506ed0df78f3bef94 (diff) |
#i61429# - Adapted UCB clients to deprecated XContentCreator interface.
Diffstat (limited to 'odk/examples/DevelopersGuide')
-rw-r--r-- | odk/examples/DevelopersGuide/UCB/ResourceCreator.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/odk/examples/DevelopersGuide/UCB/ResourceCreator.java b/odk/examples/DevelopersGuide/UCB/ResourceCreator.java index 202941e1772a..c28bc47ea866 100644 --- a/odk/examples/DevelopersGuide/UCB/ResourceCreator.java +++ b/odk/examples/DevelopersGuide/UCB/ResourceCreator.java @@ -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... |