Examples of XSimpleFileAccess


Examples of com.sun.star.ucb.XSimpleFileAccess

    public static void parseXMLFile(XMultiServiceFactory xMSF,
        String fileURL, XDocumentHandler handler) throws com.sun.star.uno.Exception
    {
        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);
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess

        m_bInWasUsed    = false     ;
        m_bOutWasUsed   = false     ;

        try
        {
            XSimpleFileAccess xHelper = (XSimpleFileAccess)
                UnoRuntime.queryInterface(XSimpleFileAccess.class,
                    ((XMultiServiceFactory)param.getMSF()).createInstance("com.sun.star.ucb.SimpleFileAccess"));
/*            com.sun.star.ucb.XSimpleFileAccess xHelper = (com.sun.star.ucb.XSimpleFileAccess)OfficeConnect.createRemoteInstance(
                com.sun.star.ucb.XSimpleFileAccess.class,
                "com.sun.star.ucb.SimpleFileAccess");*/

            if (xHelper == null)
                throw new com.sun.star.io.NotConnectedException("ucb helper not available. Can't create streams.");

            if (bInput)
            {
                m_xInStream = xHelper.openFileRead(m_sFileName);
                m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
                            com.sun.star.io.XSeekable.class,
                            m_xInStream);
            }
            else
            {
                m_xOutStream = xHelper.openFileWrite(m_sFileName);
                m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
                            com.sun.star.io.XSeekable.class,
                            m_xOutStream);
            }
        }
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess

        Object oDBDocument = xDocMSF.createInstanceWithArguments("com.sun.star.sdb.DocumentDefinition", aDocProperties);
        XHierarchicalNameContainer xHier = (XHierarchicalNameContainer) UnoRuntime.queryInterface(XHierarchicalNameContainer.class, _xDocNameAccess);
        String sdocname = Desktop.getUniqueName(_xDocNameAccess, basename);
        xHier.insertByHierarchicalName(sdocname, oDBDocument);
        XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
        XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface);
        xSimpleFileAccess.kill(sPath);
    } catch (Exception e) {
        e.printStackTrace(System.out);
    }}
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess


    public boolean storeDatabaseDocumentToTempPath(XComponent _xcomponent, String _storename){
    try{
        XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
        XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface);
        String storepath = FileAccess.getOfficePath(xMSF, "Temp", xSimpleFileAccess) + "/" + _storename;
        XStorable xStoreable = (XStorable) UnoRuntime.queryInterface(XStorable.class, _xcomponent);
        PropertyValue[] oStoreProperties = new PropertyValue[1];
        oStoreProperties[0] = Properties.createProperty("FilterName", "writer8");
        storepath += ".odt";
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess

        m_bInWasUsed    = false     ;
        m_bOutWasUsed   = false     ;

        try
        {
            XSimpleFileAccess xHelper = (XSimpleFileAccess)
                UnoRuntime.queryInterface(XSimpleFileAccess.class,
                xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess"));

            if (xHelper == null)
                throw new com.sun.star.io.NotConnectedException(
                        "ucb helper not available. Can't create streams.");

            if (bInput)
            {
                m_xInStream = xHelper.openFileRead(m_sFileName);
                m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
                            com.sun.star.io.XSeekable.class,
                            m_xInStream);
            }
            else
            {
                m_xOutStream = xHelper.openFileWrite(m_sFileName);
                m_xSeek = (com.sun.star.io.XSeekable)UnoRuntime.queryInterface(
                            com.sun.star.io.XSeekable.class,
                            m_xOutStream);
            }
        }
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess

            try {
                fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
            } catch (com.sun.star.uno.Exception ex) {
                ex.printStackTrace();
            }
            XSimpleFileAccess sA = (XSimpleFileAccess)
                            UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
                           

            dirlist(officeUserPath, xNode);
        }
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess

        try {
            fileacc = mxMSF.createInstance("com.sun.star.comp.ucb.SimpleFileAccess");
        } catch (com.sun.star.uno.Exception ex) {
            ex.printStackTrace();
        }
        XSimpleFileAccess sfa = (XSimpleFileAccess)
                        UnoRuntime.queryInterface(XSimpleFileAccess.class,fileacc);
        XMutableTreeNode xChildNode = null;
        try {
            xChildNode = mXTreeDataModel.createNode(dir.substring(dir.lastIndexOf("/")+1, dir.length()), sfa.isFolder(dir));
            xChildNode.setDataValue(dir);
            boolean test = sfa.isFolder(dir);
            if (sfa.isFolder(dir)){
                xChildNode.setExpandedGraphicURL( "private:graphicrepository/sd/res/triangle_down.png");
                xChildNode.setCollapsedGraphicURL("private:graphicrepository/sd/res/triangle_right.png");
                String[] children = sfa.getFolderContents(dir, true);
                if (children != null){
                    for (int i=0; i<children.length; i++) {
                        // Get filename of file or directory
                        String filename = children[i];
                        dirlist( filename , xChildNode);
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess

        final URL aURL = new URL();
        aURL.Complete = util.utils.getOfficeTemp(
                                (XMultiServiceFactory) tParam.getMSF()) +
                        "picture.jpg";

        final XSimpleFileAccess fAcc;

        try {
            Object oFAcc = ((XMultiServiceFactory) tParam.getMSF()).createInstance(
                                   "com.sun.star.ucb.SimpleFileAccess");
            fAcc = (XSimpleFileAccess) UnoRuntime.queryInterface(
                           XSimpleFileAccess.class, oFAcc);

            if (fAcc.exists(aURL.Complete)) {
                fAcc.kill(aURL.Complete);
            }
        } catch (com.sun.star.uno.Exception e) {
            log.println("Error accessing file system :");
            e.printStackTrace(log);
            throw new StatusException("Error accessing file system.", e);
        }

        oObj = (XInterface) go;
        log.println("ImplName " + util.utils.getImplName(oObj));

        TestEnvironment tEnv = new TestEnvironment(oObj);
        tEnv.addObjRelation("MediaDescriptor",
                            XMLTools.createMediaDescriptor(
                                    new String[] {
            "FilterName", "URL", "MediaType"
        }, new Object[] { "JPG", aURL, "image/jpeg" }));
        tEnv.addObjRelation("SourceDocument", xComp);

        log.println("adding ObjRelation for XFilter");
        log.println("This Component doesn't really support the cancel method");
        log.println("See #101725");
        tEnv.addObjRelation("NoFilter.cancel()", new Boolean(true));

        final String hideMode = (String) tParam.get("soapi.test.hidewindows");
        tEnv.addObjRelation("XFilter.Checker",
                            new ifc.document._XFilter.FilterChecker() {
            public boolean checkFilter() {
                try {
                    if ((hideMode != null) && hideMode.equals("true")) {
                        return true;
                    }

                    return fAcc.exists(aURL.Complete);
                } catch (com.sun.star.uno.Exception e) {
                    return false;
                }
            }
        });
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess

            return 0;

        if (location.equals("user"))
            return 1;

        XSimpleFileAccess access = null;
        String uri = util.utils.getFullTestURL(location);

        if (storageManager == null) {
            try {
                XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(
View Full Code Here

Examples of com.sun.star.ucb.XSimpleFileAccess

        return id;
    }

    private XSimpleFileAccess getXSimpleFileAccess() {
        XSimpleFileAccess access = null;

        try {
            Object fa = tParam.getMSF().createInstance(
                "com.sun.star.ucb.SimpleFileAccess");
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.