Examples of createFile()


Examples of org.apache.sling.ide.test.impl.helpers.RepositoryAccessor.createFile()

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/en", "nt:folder");
        repo.createNode("/content/test-root/en/files", "nt:folder");
        repo.createFile("/content/test-root/en/files/first.txt", "first file".getBytes());

        runImport(contentProject);

        assertThat(contentProject.findMember("jcr_root/content/test-root/en"), nullValue());
    }
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.RepositoryAccessor.createFile()

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.tryDeleteResource("/content/test-root");
        repo.createNode("/content/test-root", "sling:Folder");
        repo.createFile("/content/test-root/file.txt", "hello, world".getBytes());
        repo.doWithSession(new SessionRunnable<Void>() {
            @Override
            public Void doWithSession(Session session) throws RepositoryException {

                ValueFactory valueFactory = session.getValueFactory();
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.RepositoryAccessor.createFile()

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/en", "nt:folder");
        repo.createNode("/content/test-root/en/files", "nt:folder");
        repo.createFile("/content/test-root/en/files/first.txt", "first file".getBytes());
        repo.createFile("/content/test-root/en/files/second.txt", "second file".getBytes());

        // delete file since it was deployed when the module was added to the server
        repo.tryDeleteResource("/content/test-root/hello.txt");
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.RepositoryAccessor.createFile()

        // create server-side content
        RepositoryAccessor repo = new RepositoryAccessor(config);
        repo.createNode("/content/test-root/en", "nt:folder");
        repo.createNode("/content/test-root/en/files", "nt:folder");
        repo.createFile("/content/test-root/en/files/first.txt", "first file".getBytes());
        repo.createFile("/content/test-root/en/files/second.txt", "second file".getBytes());

        // delete file since it was deployed when the module was added to the server
        repo.tryDeleteResource("/content/test-root/hello.txt");

        // run initial import
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.RepositoryAccessor.createFile()

        deh.clearUnexpectedEventsAfterSettling();

        repo.createNode("/content/test-root/folder", "sling:Folder");
        repo.createNode("/content/test-root/folder/jcr:content", "nt:unstructured");
        repo.createFile("/content/test-root/folder/jcr:content/some_file.txt", "dummy contents".getBytes());
        repo.doWithSession(new SessionRunnable<Void>() {

            @Override
            public Void doWithSession(Session session) throws RepositoryException {
                session.getRootNode().getNode("content/test-root/folder/jcr:content/some_file.txt/jcr:content")
View Full Code Here

Examples of org.apache.sling.ide.test.impl.helpers.RepositoryAccessor.createFile()

        ServerAdapter server = new ServerAdapter(wstServer.getServer());
        server.installModule(contentProject);

        deh.clearUnexpectedEventsAfterSettling();

        repo.createFile("/content/test-root/sling:file", "some_content".getBytes());

        runImport(contentProject);

        assertThat(contentProject, hasFile("jcr_root/content/test-root/_sling_file"));
    }
View Full Code Here

Examples of org.eclipse.egit.core.test.TestProject.createFile()

    TestProject nested = new TestProject(true, "Project-1/Project-2");
    try {
      // Use Project-1 to create folder, Project-2 to get file to try to
      // confuse any caches in workspace root (location -> IResource).
      project.createFolder("Project-2/please");
      IFile ignoreme = nested.createFile("please/ignoreme", new byte[0]);
      IgnoreOperation operation = executeIgnore(ignoreme.getLocation());
      String content = nested.getFileContent("please/.gitignore");
      assertEquals("/ignoreme\n", content);
      assertFalse(operation.isGitignoreOutsideWSChanged());
    } finally {
View Full Code Here

Examples of org.geoserver.platform.GeoServerResourceLoader.createFile()

                throw new RestletException( msg, Status.CLIENT_ERROR_FORBIDDEN);
            }
           
            //TODO: have the writing out of the style delegate to ResourcePool.writeStyle()
            try {
                f = loader.createFile( "styles/" + name + ".sld") ;
               
                //serialize the file to the styles directory
                BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream ( f ) );
               
                SLDFormat format = new SLDFormat(true);
View Full Code Here

Examples of org.gephi.utils.TempDirUtils.TempDir.createFile()

    private void writePieChart(final StringBuilder sb, JFreeChart chart, Dimension dimension) throws IOException {

        TempDir tempDir = TempDirUtils.createTempDir();
        String imageFile = "";
        String fileName = "frequencies-pie-chart.png";
        File file = tempDir.createFile(fileName);
        imageFile = "<center><img src=\"file:" + file.getAbsolutePath() + "\"</img></center>";
        ChartUtilities.saveChartAsPNG(file, chart, dimension != null ? dimension.width : 1000, dimension != null ? dimension.height : 1000);

        sb.append(imageFile);
    }
View Full Code Here

Examples of org.gephi.utils.TempDirUtils.TempDir.createFile()

                    String next = result[i];
                    int endIndex = next.indexOf('\"');
                    String pngStr = next.substring(0, endIndex);
                    byte[] imageBytes = Base64.decodeBase64(pngStr);
                    String fileName = "image" + i + ".png";
                    File file = tempDir.createFile(fileName);

                    FileOutputStream fos = new FileOutputStream(file);
                    fos.write(imageBytes);

                    String path = "file:" + file.getAbsolutePath();
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.