Package java.nio.file

Examples of java.nio.file.Path.toFile()


        }
    }

    public void testOutputDirIsFile() throws Exception {
        Path path = Files.createTempFile("badOutput", "foo");
        RegistrySerializer rs = new RegistrySerializer(actb.getComponentsPath().toFile(), path.toFile(), null, null);
        try {
            rs.execute();
        } catch (RegistrySerializerException mee) {
            assertTrue("Expected error about output directory: "+mee.getMessage(),
                    mee.getMessage().startsWith("Output directory is not a directory:"));
View Full Code Here


        TestLogger logger = new TestLogger();
        Path compPath = actb.getComponentsPath();
        String ns = actb.getNewNamespace();
        actb.getNewObject(ns, ComponentDef.class, "<aura:component />");
        actb.installComponentLocationAdapter();
        RegistrySerializer rs = new RegistrySerializer(compPath.toFile(), compPath.toFile(), null, logger);
        try {
            rs.execute();
        } catch (RegistrySerializerException mee) {
            // Whoops.
            System.out.println(logger.getLogEntries());
View Full Code Here

        TestLogger logger = new TestLogger();
        Path compPath = actb.getComponentsPath();
        String ns = actb.getNewNamespace();
        actb.getNewObject(ns, ComponentDef.class, "<aura:component />");
        actb.installComponentLocationAdapter();
        RegistrySerializer rs = new RegistrySerializer(compPath.toFile(), compPath.toFile(), null, logger);
        try {
            rs.execute();
        } catch (RegistrySerializerException mee) {
            // Whoops.
            System.out.println(logger.getLogEntries());
View Full Code Here

        Path compPath = actb.getComponentsPath();
        String ns = actb.getNewNamespace();
        // deliberate missing component
        actb.getNewObject(ns, ComponentDef.class, "<aura;component><aura:IDontExistReallyReally /></aura:component>");
        actb.installComponentLocationAdapter();
        RegistrySerializer rs = new RegistrySerializer(compPath.toFile(), compPath.toFile(), null, logger);
        try {
            rs.execute();
            fail("We should fail to execute with an error");
        } catch (RegistrySerializerException mee) {
            assertEquals("one or more errors occurred during compile", mee.getMessage());
View Full Code Here

        Path compPath = actb.getComponentsPath();
        String ns = actb.getNewNamespace();
        // deliberate missing component
        actb.getNewObject(ns, ComponentDef.class, "<aura;component><aura:IDontExistReallyReally /></aura:component>");
        actb.installComponentLocationAdapter();
        RegistrySerializer rs = new RegistrySerializer(compPath.toFile(), compPath.toFile(), null, logger);
        try {
            rs.execute();
            fail("We should fail to execute with an error");
        } catch (RegistrySerializerException mee) {
            assertEquals("one or more errors occurred during compile", mee.getMessage());
View Full Code Here

        }
        finally {
            if (ddlWriter != null)
                ddlWriter.close();
            Path ddlPath = Paths.get(ddlName);
            if (ddlPath.toFile().exists()) {
                Files.delete(ddlPath);
            }

            Path jarPath = Paths.get(jarName);
            if (jarPath.toFile().exists()) {
View Full Code Here

            if (ddlPath.toFile().exists()) {
                Files.delete(ddlPath);
            }

            Path jarPath = Paths.get(jarName);
            if (jarPath.toFile().exists()) {
                Files.delete(jarPath);
            }
        }

        return report;
View Full Code Here

      fValue = null;
    else
    {
      try
      {
        fValue = storeValue.toFile();
      }
      catch (UnsupportedOperationException e)
      {
        //May occur if the path is not from the local file system and the path does not support creating Files
        throw new PreferencesException("Path '" + storeValue + "' cannot be converted to File.", e);
View Full Code Here

        // write source urls to text file
        String bundleName = FilenameUtils.removeExtension(fileName);
        Path sourceUrlFile = subDir.resolve(bundleName + ".txt");
        String sourceString = String.format("Bundle: %s\nIndex: %s",
                unityUrl.toString(), indexUrl.toString());
        FileUtils.writeStringToFile(sourceUrlFile.toFile(), sourceString);
    }
   
    private InputStream getHTTPInputStream(URL url) throws IOException {
        HttpURLConnection con = (HttpURLConnection) url.openConnection();
       
View Full Code Here

                            }
                        }
                    }

                    if (kind == StandardWatchEventKinds.ENTRY_MODIFY) {
                        LOGGER.info("Last modified: {}", child.toFile().lastModified());

                    }
                }

                if (key.reset() == false) {
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.