Examples of XTruncate


Examples of com.sun.star.io.XTruncate

                    LogUtils.DEBUG("getOutputStream, create o/p  stream  for file eg. " + path  );

                    // we will only deal with simple file write
                    XOutputStream xos = m_xSimpleFileAccess.openFileWrite( path );
                    XTruncate xtrunc = ( XTruncate ) UnoRuntime.queryInterface( XTruncate.class, xos );
                    if ( xtrunc != null )
                    {
                        xtrunc.truncate();
                    }
                    os = new XOutputStreamWrapper( xos );
                }
                if ( os == null )
                {
View Full Code Here

Examples of com.sun.star.io.XTruncate

        try
        {
            String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
            String packagesUrl = PathUtils.make_url( path, "Scripts/unopkg-desc.xml" );
            xos =  m_xSFA.openFileWrite( packagesUrl );
            XTruncate xTrc = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xos );
            if xTrc != null )
            {
                LogUtils.DEBUG("In writeUnoPackageDB() Truncating...." );
                xTrc.truncate();
            }
            else
            {
                LogUtils.DEBUG("In writeUnoPackageDB() CANT Truncate...." );
            }
View Full Code Here

Examples of com.sun.star.io.XTruncate

        try
        {
            String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
            String packagesUrl = PathUtils.make_url( path, "Scripts/unopkg-desc.xml" );
            xos =  m_xSFA.openFileWrite( packagesUrl );
            XTruncate xTrc = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xos );
            if xTrc != null )
            {
                LogUtils.DEBUG("In writeUnoPackageDB() Truncating...." );
                xTrc.truncate();
            }
            else
            {
                LogUtils.DEBUG("In writeUnoPackageDB() CANT Truncate...." );
            }
View Full Code Here

Examples of com.sun.star.io.XTruncate

        XStream xLinkStream = m_xStorage.openStreamElement( "LinkName", ElementModes.ELEMENT_WRITE );

        if ( xLinkStream != null )
        {
          XOutputStream xLinkOutStream = xLinkStream.getOutputStream();
          XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class,
                                         xLinkOutStream );
          if ( xLinkOutStream != null && xTruncate != null )
          {
            xTruncate.truncate();
 
            char[] aLinkChar = m_aLinkURI.toCharArray();
            byte[] aLinkBytes = new byte[ aLinkChar.length ];
            for ( int ind = 0; ind < aLinkChar.length; ind++ )
              aLinkBytes[ind] = (byte)aLinkChar[ind];
View Full Code Here

Examples of com.sun.star.io.XTruncate

            XComponent xStreamComp = ( XComponent ) UnoRuntime.queryInterface( XComponent.class, xStream );
            if ( xStreamComp == null )
                throw new com.sun.star.uno.RuntimeException();

            XOutputStream xOutStream = xStream.getOutputStream();
            XTruncate xTruncate = ( XTruncate ) UnoRuntime.queryInterface( XTruncate.class, xOutStream );
            if ( xTruncate == null )
                throw new com.sun.star.io.IOException();

            xTruncate.truncate();
            xOutStream.writeBytes( aString.getBytes() );

            // save the size
            xStream = xStorage.openStreamElement( "properties.txt", com.sun.star.embed.ElementModes.READWRITE );
            xStreamComp = ( XComponent ) UnoRuntime.queryInterface( XComponent.class, xStream );
            if ( xStreamComp == null )
                throw new com.sun.star.uno.RuntimeException();

            xOutStream = xStream.getOutputStream();
            xTruncate = ( XTruncate ) UnoRuntime.queryInterface( XTruncate.class, xOutStream );
            if ( xTruncate == null )
                throw new com.sun.star.io.IOException();

            xTruncate.truncate();
            String aProps = Integer.toString( (int)aDimension.getWidth() ) + "|" + Integer.toString( (int)aDimension.getHeight() );
            xOutStream.writeBytes( aProps.getBytes() );

            // set the media type
            XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, xStorage );
View Full Code Here

Examples of com.sun.star.io.XTruncate

                    LogUtils.DEBUG("getOutputStream, create o/p  stream  for file eg. " + path  );

                    // we will only deal with simple file write
                    XOutputStream xos = m_xSimpleFileAccess.openFileWrite( path );
                    XTruncate xtrunc = ( XTruncate ) UnoRuntime.queryInterface( XTruncate.class, xos );
                    if ( xtrunc != null )
                    {
                        xtrunc.truncate();
                    }
                    os = new XOutputStreamWrapper( xos );
                }
                if ( os == null )
                {
View Full Code Here

Examples of com.sun.star.io.XTruncate

        XStream xLinkStream = m_xStorage.openStreamElement( "LinkName", ElementModes.ELEMENT_WRITE );

        if ( xLinkStream != null )
        {
          XOutputStream xLinkOutStream = xLinkStream.getOutputStream();
          XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class,
                                         xLinkOutStream );
          if ( xLinkOutStream != null && xTruncate != null )
          {
            xTruncate.truncate();
 
            char[] aLinkChar = m_aLinkURI.toCharArray();
            byte[] aLinkBytes = new byte[ aLinkChar.length ];
            for ( int ind = 0; ind < aLinkChar.length; ind++ )
              aLinkBytes[ind] = (byte)aLinkChar[ind];
View Full Code Here

Examples of com.sun.star.io.XTruncate

        try
        {
//            String path = containerUrl.substring( 0, containerUrl.lastIndexOf("/") );
            String packagesUrl = PathUtils.make_url( extensionDb, "/Scripts/" + extensionRepository + "-extension-desc.xml" );
            xos =  m_xSFA.openFileWrite( packagesUrl );
            XTruncate xTrc = (XTruncate) UnoRuntime.queryInterface( XTruncate.class, xos );
            if xTrc != null )
            {
                LogUtils.DEBUG("In writeUnoPackageDB() Truncating...." );
                xTrc.truncate();
            }
            else
            {
                LogUtils.DEBUG("In writeUnoPackageDB() CANT Truncate...." );
            }
View Full Code Here

Examples of com.sun.star.io.XTruncate

            XComponent xStreamComp = ( XComponent ) UnoRuntime.queryInterface( XComponent.class, xStream );
            if ( xStreamComp == null )
                throw new com.sun.star.uno.RuntimeException();

            XOutputStream xOutStream = xStream.getOutputStream();
            XTruncate xTruncate = ( XTruncate ) UnoRuntime.queryInterface( XTruncate.class, xOutStream );
            if ( xTruncate == null )
                throw new com.sun.star.io.IOException();

            xTruncate.truncate();
            xOutStream.writeBytes( aString.getBytes() );

            // save the size
            xStream = xStorage.openStreamElement( "properties.txt", com.sun.star.embed.ElementModes.READWRITE );
            xStreamComp = ( XComponent ) UnoRuntime.queryInterface( XComponent.class, xStream );
            if ( xStreamComp == null )
                throw new com.sun.star.uno.RuntimeException();

            xOutStream = xStream.getOutputStream();
            xTruncate = ( XTruncate ) UnoRuntime.queryInterface( XTruncate.class, xOutStream );
            if ( xTruncate == null )
                throw new com.sun.star.io.IOException();

            xTruncate.truncate();
            String aProps = Integer.toString( (int)aDimension.getWidth() ) + "|" + Integer.toString( (int)aDimension.getHeight() );
            xOutStream.writeBytes( aProps.getBytes() );

            // set the media type
            XPropertySet xPropSet = (XPropertySet)UnoRuntime.queryInterface( XPropertySet.class, xStorage );
View Full Code Here

Examples of com.sun.star.io.XTruncate

        XStream xLinkStream = m_xStorage.openStreamElement( "LinkName", ElementModes.ELEMENT_WRITE );

        if ( xLinkStream != null )
        {
          XOutputStream xLinkOutStream = xLinkStream.getOutputStream();
          XTruncate xTruncate = (XTruncate) UnoRuntime.queryInterface( XTruncate.class,
                                         xLinkOutStream );
          if ( xLinkOutStream != null && xTruncate != null )
          {
            xTruncate.truncate();
 
            char[] aLinkChar = m_aLinkURI.toCharArray();
            byte[] aLinkBytes = new byte[ aLinkChar.length ];
            for ( int ind = 0; ind < aLinkChar.length; ind++ )
              aLinkBytes[ind] = (byte)aLinkChar[ind];
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.