Package org.apache.commons.vfs

Examples of org.apache.commons.vfs.FileObject.createFile()


        String resourcePath = resource.getURL().getPath();
        if (!resourcePath.startsWith(basePath)) {
          throw new WGAServiceException(new IllegalArgumentException("Illegal design resource path '" + path + "'."));
        }

        resource.createFile();
        OutputStream out = resource.getContent().getOutputStream();
        InputStream in = content.getInputStream();
        WGUtils.inToOut(in, out, 1024);
        out.close();
        in.close();
View Full Code Here


            // if encoding not specified set to platform encoding
            _syncInfo.setFileEncoding(System.getProperty("file.encoding"));
        }
        FileObject syncInfoFile = getSyncInfoFile();
        _log.info("Creating design definition file " + syncInfoFile.getName().getPath());
        syncInfoFile.createFile();
        storeSyncInfo(syncInfoFile);

        _log.info("Initial deploy finished");

    }
View Full Code Here

        // Create code file
        FileObject codeFile = currentDir.resolveFile(localName + info.getSuffix());
        _log.info("Creating script module file " + getRelativePath(codeFile));
        try {
            codeFile.createFile();
        }
        catch (FileSystemException e) {
            throw new WGInitialDeployException("Could not create script code file '" + codeFile.getName().getPathDecoded() + "'");
        }
        Writer writer = createWriter(codeFile);
View Full Code Here

            fileName = (String) fileNames.next();
            InputStream in = con.getFileData(fileName);
            file = containerFolder.resolveFile(fileName);
            _log.info("Creating file container file " + getRelativePath(file));
            try {
                file.createFile();
            }
            catch (FileSystemException e) {
                throw new WGInitialDeployException("Could not create container file '" + getRelativePath(file) + "'", e);
            }
            OutputStream out = file.getContent().getOutputStream();
View Full Code Here

        // Create code file
        FileObject tmlCodeFile = currentDir.resolveFile(localName + DesignDirectory.SUFFIX_TML);
        _log.info("Creating tml module file " + getRelativePath(tmlCodeFile));
        try {
            tmlCodeFile.createFile();
        }
        catch (FileSystemException e) {
            throw new WGInitialDeployException("Could not create tml code file '" + getRelativePath(tmlCodeFile) + "'");
        }
        Writer writer = createWriter(tmlCodeFile);
View Full Code Here

                case WGDocument.TYPE_TML:{
                    FileObject newTml = getTmlFolder().resolveFile(mediaKey.toLowerCase() + "/" + name.replace(":", "/") + ".tml");
                    if (newTml.exists()) {
                        throw new WGCreationException("Document already exists: " + (new WGDocumentKey(type, name, mediaKey)).toString());
                    }
                    newTml.createFile();
                    break;
                }
                   
                   
                case WGDocument.TYPE_CSSJS: {
View Full Code Here

                    String suffix = DesignDirectory.getScriptInformation(mediaKey).getSuffix();
                    FileObject newScript = getScriptTypeFolder(mediaKey).resolveFile(mediaKey.toLowerCase() + "/" + name.replace(":", "/") + suffix);
                    if (newScript.exists()) {
                        throw new WGCreationException("Document already exists: " + (new WGDocumentKey(type, name, mediaKey)).toString());
                    }
                    newScript.createFile();
                    break;
                }
                   
                   
                case WGDocument.TYPE_FILECONTAINER: {
View Full Code Here

         if (!systemFC.exists()) {
             systemFC.createFolder();
         }
         FileObject overlayFlag = systemFC.resolveFile("overlay.flg");
         if (!overlayFlag.exists()) {
             overlayFlag.createFile();
         }
    }

    private void copyNewResources(FileObject source, FileObject target) throws FileSystemException, WGDesignSyncException {
View Full Code Here

  FileObject imageFileObject = folder.resolveFile(filename);
 
    if (imageFileObject.exists()) {
      log.warn("Overwriting (!) existing file!");
    } else {
      imageFileObject.createFile();
    }
   
    // System.out.println("URL: " +
    // fo.getURL().toExternalForm() );
    // System.out.println("String: " + fo.toString() );
View Full Code Here

        file.getParent().createFolder();
        if (!file.exists())
        {
            System.out.println("File " + FileUtils.getAbsolutePath(file) + " for property " + propertyName + " not found! \n Will be created!");
            file.createFile();
        }

        if (FileUtils.isFolder(file))
        {
            OwnSyncException ose = new OwnSyncException("File " + FileUtils.getAbsolutePath(file) + " for property " + propertyName + " is not a file! \n EXITING!");
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.