Package java.util

Examples of java.util.Properties.clear()


            }
            byte[] bytes = baos.toByteArray();
            baos.close();

            Reader reader = new InputStreamReader(new ByteArrayInputStream(bytes));
            localeProperties.clear();
            localeProperties.load(reader);
            reader.close();

            currentLocaleEntryNameIndex = localeEntryNameIndex;
            if (localeEntryNameIndex == 0) {
View Full Code Here


        Properties p = new Properties();
        for (int i = propFiles.length;   i-- > 0;   ) {
            if (propFiles[i] != null) {
                p.load(new FileInputStream(propFiles[i]));
                dictionary.putAll(p);
                p.clear();
            }
        }
        resolveProperties();       
    }
   
View Full Code Here

        FileOutputStream outputStream = new FileOutputStream(file0);
        props.store(outputStream, "zero file");
        outputStream.close();

        File file1 = new File(this.bundleFilesDir, "one.properties");
        props.clear();
        props.setProperty("one", "1");
        outputStream = new FileOutputStream(file1);
        props.store(outputStream, "one file");
        outputStream.close();
View Full Code Here

        outputStream = new FileOutputStream(file1);
        props.store(outputStream, "one file");
        outputStream.close();

        File file2 = new File(this.bundleFilesDir, "two.properties");
        props.clear();
        props.setProperty("two", "2");
        outputStream = new FileOutputStream(file2);
        props.store(outputStream, "two file");
        outputStream.close();
View Full Code Here

        outputStream.close();

        // create some external test files that don't belong to the bundle but are in the dest dir (which is not fully managed by the bundle)
        this.destDir.mkdirs();
        File external1 = new File(this.destDir, "external1.properties");
        props.clear();
        props.setProperty("external1", "1");
        outputStream = new FileOutputStream(external1);
        props.store(outputStream, "external1 file");
        outputStream.close();
View Full Code Here

        props.store(outputStream, "external1 file");
        outputStream.close();

        File external2 = new File(this.destDir, "extdir/external2.properties");
        external2.getParentFile().mkdirs();
        props.clear();
        props.setProperty("external2", "2");
        outputStream = new FileOutputStream(external2);
        props.store(outputStream, "external2 file");
        outputStream.close();
View Full Code Here

        outputStream.close();

        // this extra file is already in the subdir1 directory when the deployment happens - it should be removed
        File extraSubdirFile = new File(this.destDir, "subdir1/extra.properties");
        extraSubdirFile.getParentFile().mkdirs();
        props.clear();
        props.setProperty("extra", "3");
        outputStream = new FileOutputStream(extraSubdirFile);
        props.store(outputStream, "extra subdir1 file");
        outputStream.close();
View Full Code Here

        BundleDeployResult results = plugin.deployBundle(request);

        assertResultsSuccess(results);

        // test that files were deployed in the proper place
        props.clear();
        loadProperties(props, new FileInputStream(new File(this.destDir, "zero.properties")));
        assert "0".equals(props.getProperty("zero")) : "did not deploy bundle correctly 0";
        loadProperties(props, new FileInputStream(new File(this.destDir, "subdir1/one.properties")));
        assert "1".equals(props.getProperty("one")) : "did not deploy bundle correctly 1";
        loadProperties(props, new FileInputStream(new File(this.destDir, "subdir2/two.properties")));
View Full Code Here

        DeploymentsMetadata metadata = new DeploymentsMetadata(this.destDir);
        assert metadata.isManaged() == true : "missing metadata directory";
        assert metadata.getCurrentDeploymentProperties().getManageRootDir() == false : "should not be managing root dir";

        // make sure our unmanaged files/directories weren't removed
        props.clear();
        loadProperties(props, new FileInputStream(new File(this.destDir, "external1.properties")));
        assert "1".equals(props.getProperty("external1")) : "bundle deployment removed our unmanaged file 1";
        loadProperties(props, new FileInputStream(new File(this.destDir, "extdir/external2.properties")));
        assert "2".equals(props.getProperty("external2")) : "bundle deployment removed our unmanaged file 2";
View Full Code Here

        metadata = new DeploymentsMetadata(this.destDir);
        assert metadata.getMetadataDirectory().exists() == false : "metadata directory should not exist";

        // make sure our external, unmanaged files still exist - the purge should not have deleted these
        props.clear();
        loadProperties(props, new FileInputStream(new File(this.destDir, "external1.properties")));
        assert "1".equals(props.getProperty("external1")) : "bundle purge removed our unmanaged file 1";
        loadProperties(props, new FileInputStream(new File(this.destDir, "extdir/external2.properties")));
        assert "2".equals(props.getProperty("external2")) : "bundle purge removed our unmanaged file 2";
    }
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.