Package com.sun.star.io

Examples of com.sun.star.io.XInputStream


    public boolean setDataStream( String sourceURL )
        throws com.sun.star.ucb.CommandAbortedException,
               com.sun.star.uno.Exception,
               java.lang.Exception {

         XInputStream stream;
         if ( sourceURL == null || sourceURL.equals("") )  {
            stream = new MyInputStream();
         } else {
            String connect = getConnect();
            String[] args =  new String[ 2 ];
View Full Code Here


     */
    public boolean setDataStream( XInputStream stream )
        throws com.sun.star.ucb.CommandAbortedException, com.sun.star.uno.Exception {

        boolean result = false;
        XInputStream data = stream;
        if ( data != null && m_content != null )  {

            // Fill argument structure...
            InsertCommandArgument arg = new InsertCommandArgument();
            arg.Data = data;
View Full Code Here

            XOutputStream xFooOut =
                new StreamSimulator(tempDir + "empty.rdf", false, param);
            xRep.exportGraph(FileFormat.RDF_XML, xFooOut, foo, base);
            xFooOut.closeOutput();

            XInputStream xFooIn =
                new StreamSimulator(tempDir + "empty.rdf", true, param);
            xRep.importGraph(FileFormat.RDF_XML, xFooIn, bar, base);
            assertNotNull("no bar graph", xRep.getGraph(bar));

            System.out.println("...done");
View Full Code Here

    {
        try {

            System.out.println("Checking SPARQL queries...");

            XInputStream xIn = new StreamSimulator(TestDocument.getUrl("example.rdf"), true, param);
                // util.utils.getFullTestDocName("example.rdf"), true, param);
            xRep.importGraph(FileFormat.RDF_XML, xIn, manifest, base);

            String query;
            query = "SELECT ?p WHERE { ?p rdf:type pkg:Package . }";
View Full Code Here

        try {
            xBuilder.parse(null);
            fail("XDocumentBuilder.parse(null)");
        } catch (Exception e) { /* expected */ }
        {
            XInputStream xIn = new StreamSimulator(
                    TestDocument.getUrl("example.rdf"), true, m_params);
            XDocument xDoc = xBuilder.parse(xIn);
            assertNotNull("XDocumentBuilder.parse", xDoc);
        }
        try {
View Full Code Here

      
    }
   
    protected static XInputStream SaveHTMLTemp( XComponentContext xContext, String sArticle )
    {
        XInputStream xResult = null;

        if ( xContext != null )
        {
            try
            {           
                Object oTempFile = xContext.getServiceManager().createInstanceWithContext( "com.sun.star.io.TempFile", xContext );
                XStream xStream = ( XStream ) UnoRuntime.queryInterface( XStream.class, oTempFile );
                XSeekable xSeekable = ( XSeekable ) UnoRuntime.queryInterface( XSeekable.class, oTempFile );
                if ( xStream != null && xSeekable != null )
                {
                    XOutputStream xOutputStream = xStream.getOutputStream();
                    XInputStream xInputStream = xStream.getInputStream();
                    if ( xOutputStream != null && xInputStream != null )
                    {
                        String sHTML = sHTMLHeader.concat( sArticle );
                        sHTML = sHTML.concat( sHTMLFooter );
                        xOutputStream.writeBytes( sHTML.getBytes( "UTF-8" ) );           
View Full Code Here

            Object oTempFile = xContext.getServiceManager().createInstanceWithContext( "com.sun.star.io.TempFile", xContext );
            XPropertySet xPropertySet = ( XPropertySet ) UnoRuntime.queryInterface( XPropertySet.class, oTempFile );
            xPropertySet.setPropertyValue( "RemoveFile", Boolean.FALSE );
            sURL = ( String ) xPropertySet.getPropertyValue( "Uri" );

            XInputStream xInputStream = ( XInputStream ) UnoRuntime.queryInterface( XInputStream.class, oTempFile );
            xInputStream.closeInput();
            XOutputStream xOutputStream = ( XOutputStream ) UnoRuntime.queryInterface( XOutputStream.class, oTempFile );
            xOutputStream.closeOutput();
        } catch ( com.sun.star.uno.Exception ex )
        {
            ex.printStackTrace();
View Full Code Here

    {
        XInterface oFacc = (XInterface)xMSF.createInstance(
            "com.sun.star.comp.ucb.SimpleFileAccess");
        XSimpleFileAccess xFacc = (XSimpleFileAccess)UnoRuntime.queryInterface
            (XSimpleFileAccess.class, oFacc) ;
        XInputStream oIn = xFacc.openFileRead(fileURL) ;

        XInterface oParser = (XInterface)xMSF.createInstance(
            "com.sun.star.xml.sax.Parser");
        XParser xParser = (XParser) UnoRuntime.queryInterface(XParser.class, oParser);

        xParser.setDocumentHandler(handler) ;
        InputSource inSrc = new InputSource() ;
        inSrc.aInputStream = oIn ;
        xParser.parseStream(inSrc) ;

        oIn.closeInput();
    }
View Full Code Here

      if ( xNameAccess.hasByName( "LinkName" ) && xTargetStorage.isStreamElement( "LinkName" ) )
      {
        XStream xLinkStream = xTargetStorage.openStreamElement( "LinkName", ElementModes.ELEMENT_READ );
        if ( xLinkStream != null )
        {
          XInputStream xInStream = xLinkStream.getInputStream();
          if ( xInStream != null )
          {
            byte[][] pBuff = new byte[1][0];
            int nRead = xInStream.readBytes( pBuff, 1000 );
            m_aLinkURI = new String( pBuff[0] );
            xInStream.closeInput();
            oEmbObj = xEmbedFactory.createInstanceLink( m_aLinkURI );
            m_bLinkObj = true;
          }
        }
      }
View Full Code Here

            XActiveDataSink xdSmi = (XActiveDataSink)
                UnoRuntime.queryInterface(XActiveDataSink.class, mistream);
            XActiveDataSource xdSmo = (XActiveDataSource)
                UnoRuntime.queryInterface(XActiveDataSource.class, mostream);

            XInputStream miStream = (XInputStream)
                UnoRuntime.queryInterface(XInputStream.class, mistream);
            XOutputStream moStream = (XOutputStream)
                UnoRuntime.queryInterface(XOutputStream.class, mostream);
            XInputStream PipeIn = (XInputStream)
                UnoRuntime.queryInterface(XInputStream.class, aPipe);
            XOutputStream PipeOut = (XOutputStream)
                UnoRuntime.queryInterface(XOutputStream.class,aPipe);

            xdSi.setInputStream(miStream);
View Full Code Here

TOP

Related Classes of com.sun.star.io.XInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.