Public Member Functions

DojoFileStorageProvider Class Reference

Public Member Functions

String load (String filePath) throws IOException, FileNotFoundException
void save (String filePath, String content) throws IOException, FileNotFoundException
void remove (String filePath) throws IOException, FileNotFoundException

Detailed Description

Definition at line 16 of file DojoFileStorageProvider.java.


Member Function Documentation

String load ( String  filePath  )  throws IOException, FileNotFoundException [inline]

Definition at line 17 of file DojoFileStorageProvider.java.

                                                     {
        StringBuffer results = new StringBuffer();
        BufferedReader reader = new BufferedReader(
                    new FileReader(filePath));  
        String line = null;
        while((line = reader.readLine()) != null){
            results.append(line);
        }

        reader.close();

        return results.toString();
    }

void remove ( String  filePath  )  throws IOException, FileNotFoundException [inline]

Definition at line 42 of file DojoFileStorageProvider.java.

                                                     {
        File f = new File(filePath);

        if(f.exists() == false || f.isDirectory()){
            return;
        }

        if(f.exists() && f.isFile()){
            f.delete();
        }
    }

void save ( String  filePath,
String  content 
) throws IOException, FileNotFoundException [inline]

Definition at line 32 of file DojoFileStorageProvider.java.

                                                     {
        PrintWriter writer = new PrintWriter(
                    new BufferedWriter(
                        new FileWriter(filePath, false)));
        writer.print(content);

        writer.close();
    }


The documentation for this class was generated from the following file:

For more help developing with SiT! see http://sitracker.org/wiki/DevelopmentHowTo

© 2008-2011 Support Incident Tracker

Tsohost Logo