Examples of createNewFile()


Examples of org.exist.util.io.Resource.createNewFile()

            error("failed to create a new directory '" + aNewDir.getAbsolutePath() + "'.", null);
        }
        for(int i=0; i < localFiles.length; i++){
          Resource aNewFile = localFiles[i];
            try {
              if (!aNewFile.createNewFile()) {
                  error("failed to create a new file '"
                          + aNewFile.getAbsolutePath() + "'.", null);
              }
          } catch (IOException ioe) {
              aNewFile.delete();
View Full Code Here

Examples of org.h2.store.fs.FileSystem.createNewFile()

            fs.delete(s);
        }
        fs.createDirs(fsBase + "/test/x");
        fs.delete(fsBase + "/test");
        fs.delete(fsBase + "/test2");
        assertTrue(fs.createNewFile(fsBase + "/test"));
        assertTrue(fs.canWrite(fsBase + "/test"));
        FileObject fo = fs.openFileObject(fsBase + "/test", "rw");
        byte[] buffer = new byte[10000];
        Random random = new Random(1);
        random.nextBytes(buffer);
View Full Code Here

Examples of org.jboss.forge.addon.git.gitignore.resources.GitIgnoreResource.createNewFile()

      GitIgnoreResource resource = getSelectedProject(context).getRootDirectory().getChildOfType(
               GitIgnoreResource.class,
               ".gitignore");
      if (resource == null || !resource.exists())
      {
         resource.createNewFile();
      }
      return resource;
   }

   protected boolean isGitIgnoreSelected(UIContext context)
View Full Code Here

Examples of org.jboss.forge.addon.maven.resources.MavenModelResource.createNewFile()

   public boolean install()
   {
      if (!isInstalled())
      {
         MavenModelResource pom = getModelResource();
         if (!pom.createNewFile())
            throw new IllegalStateException("Could not create POM file.");
         pom.setContents(createDefaultPOM());
      }
      return isInstalled();
   }
View Full Code Here

Examples of org.jboss.forge.addon.maven.resources.MavenPomResource.createNewFile()

   public boolean install()
   {
      if (!isInstalled())
      {
         MavenPomResource pom = getPomResource();
         if (!pom.createNewFile())
            throw new IllegalStateException("Could not create POM file.");
         pom.setContents(createDefaultPOM());
      }
      return isInstalled();
   }
View Full Code Here

Examples of org.jboss.forge.addon.parser.java.resources.JavaResource.createNewFile()

   public void testJavaResourceCreation() throws Exception
   {
      JavaClassSource javaClass = Roaster.create(JavaClassSource.class).setPackage("org.jboss.forge.test")
               .setName("Example");
      JavaResource resource = factory.create(JavaResource.class, File.createTempFile("forge", ".java"));
      resource.createNewFile();
      resource.setContents(javaClass);

      Assert.assertEquals("Example", resource.getJavaType().getName());
      Assert.assertEquals("org.jboss.forge.test", resource.getJavaType().getPackage());
   }
View Full Code Here

Examples of org.jboss.forge.maven.resources.MavenPomResource.createNewFile()

   public boolean install()
   {
      if (!isInstalled())
      {
         MavenPomResource pom = getPomResource();
         if (!pom.createNewFile())
            throw new IllegalStateException("Could not create POM file.");

         pom.setContents(getClass().getClassLoader().getResourceAsStream("/pom-template.xml"));
      }
      return isInstalled();
View Full Code Here

Examples of org.jboss.forge.resources.PropertiesFileResource.createNewFile()

      DirectoryResource resourceFolder = project.getFacet(ResourceFacet.class).getResourceFolder();

      PropertiesFileResource bundleFile = resourceFolder.getChildOfType(PropertiesFileResource.class, fullBundleFile);
      if (!bundleFile.exists())
      {
         bundleFile.createNewFile();
      }

      shell.setCurrentResource(bundleFile);

      out.println("Bundle " + bundleFile + " has been created !");
View Full Code Here

Examples of org.jboss.forge.resources.java.JavaResource.createNewFile()

         javaClass.addInterface(Serializable.class);
      }
      JavaResource resource = javaSourceFacet.getJavaResource(javaClass);
      if (!resource.exists())
      {
         resource.createNewFile();
         ejb = javaClass;
      }
      else
      {
         if (shell.promptBoolean("The EJB class already exists, do you want to overwrite it?"))
View Full Code Here

Examples of org.jboss.forge.shell.PluginJar.createNewFile()

            ((FileResource<?>) res).deleteOnExit();
      }

      String finalName = new PluginJar(dep, version + 1).getFullName();
      FileResource<?> jar = (FileResource<?>) pluginDir.getChild(finalName);
      jar.createNewFile();
      return jar;
   }

   private class StartsWith implements ResourceFilter
   {
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.