Examples of TempPath


Examples of org.apache.james.mime4j.util.TempPath

                   new File(path.getAbsolutePath()).exists());
    }

    public void testCreateTempFile() throws IOException {
        SimpleTempStorage man = new SimpleTempStorage();
        TempPath path = man.getRootTempPath().createTempPath();
        TempFile file = path.createTempFile();
        assertTrue(file.getAbsolutePath().startsWith(path.getAbsolutePath()));
       
        String fileName = file.getAbsolutePath().substring(
                file.getAbsolutePath().lastIndexOf(File.separatorChar) + 1);
        assertTrue("Unexpected chars in file name " + fileName,
                    fileName.matches("^[0-9]+\\.tmp$"));
View Full Code Here

Examples of org.apache.james.mime4j.util.TempPath

        assertEquals(s, new String(buffer, 0, i));
    }
   
    public void testCreateTempFileStringString() throws IOException {
        SimpleTempStorage man = new SimpleTempStorage();
        TempPath path = man.getRootTempPath().createTempPath();
        TempFile file = path.createTempFile("test_prefix", ".suffix");
        assertTrue(file.getAbsolutePath().startsWith(path.getAbsolutePath()));
       
        String fileName = file.getAbsolutePath().substring(
                file.getAbsolutePath().lastIndexOf(File.separatorChar) + 1);
        assertTrue("Unexpected chars in file name " + fileName,
                    fileName.matches("^test_prefix[0-9]+\\.suffix$"));
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.