Package org.apache.james.mime4j.util

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


* @version $Id: SimpleTempStorageTest.java,v 1.2 2004/10/02 12:41:12 ntherning Exp $
*/
public class SimpleTempStorageTest extends TestCase {

    public void testGetRootTempPath() {
        SimpleTempStorage man = new SimpleTempStorage();
        TempPath path = man.getRootTempPath();
        File tmpdir = new File(System.getProperty("java.io.tmpdir"));
        assertEquals(tmpdir.getAbsolutePath(), path.getAbsolutePath());
    }
View Full Code Here


        File tmpdir = new File(System.getProperty("java.io.tmpdir"));
        assertEquals(tmpdir.getAbsolutePath(), path.getAbsolutePath());
    }

    public void testCreateTempPath() throws IOException {
        SimpleTempStorage man = new SimpleTempStorage();
        TempPath path = man.getRootTempPath().createTempPath();
        File tmpdir = new File(System.getProperty("java.io.tmpdir"));
        assertTrue(path.getAbsolutePath().startsWith(tmpdir.getAbsolutePath()));
       
        String fileName = path.getAbsolutePath().substring(
                path.getAbsolutePath().lastIndexOf(File.separatorChar) + 1);
View Full Code Here

        assertTrue("Temp dir doesn't exist",
                   new File(path.getAbsolutePath()).exists());
    }

    public void testCreateTempPathString() throws IOException {
        SimpleTempStorage man = new SimpleTempStorage();
        TempPath path = man.getRootTempPath().createTempPath("test_prefix");
        File tmpdir = new File(System.getProperty("java.io.tmpdir"),
                               "test_prefix");
        assertTrue(path.getAbsolutePath().startsWith(tmpdir.getAbsolutePath()));
       
        String fileName = path.getAbsolutePath().substring(
View Full Code Here

        assertTrue("Temp dir doesn't exist",
                   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);
View Full Code Here

        assertTrue(s.length() == i);
        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);
View Full Code Here

TOP

Related Classes of org.apache.james.mime4j.util.SimpleTempStorage

Copyright © 2018 www.massapicom. 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.