Package KFM

Examples of KFM.File


        } else if ((aLogLevel > DEBUG_LEVEL) || (aLogLevel < DEACTIVATE_LEVEL)){
            throw new ProgrammerException("Wrong LogLevel!");
        } else {
            try {
                // open the file aLogFile in append and autoflush mode
                mFileSize = (new File(aLogFileName)).length();
                FileOutputStream tFileOutputStream = new FileOutputStream(aLogFileName, true);
                mPrintStream   = new PrintStream(new BufferedOutputStream(tFileOutputStream, 4096) , true);
                mLoggingLevel  = aLogLevel;
                mLogFileName   = aLogFileName;
                mLoggingEnabled = true;
View Full Code Here


        try {
            // rename existing log files
            for(int i = MAX_BACKUP_LOG_FILES - 1; i >= 0; i--) {
                // special case handling: there is no 'log0' it's just 'log'
                FileUtils.moveFile(
                    new File(mLogFileName + (0 == i ? "" : "" + i)),
                    new File(mLogFileName + (i+1)));
            }

            // open new log file (with the same name)
            FileOutputStream tFileOutputStream =
                new FileOutputStream(mLogFileName);
View Full Code Here

    {
        super(aServerName,
        aServerPort,
        "resources",
        "resources",
        new File(aTempDir));

        //load the properties
        Properties tHelpProps = new Properties();
        tHelpProps.load(new FileInputStream (aConfigPath));
View Full Code Here

    * Create the new dirs. If file already exists on file system
    * delete it to prevent errors if it is write protected.
    */
    private void ensurePathForFileExists(File aFile)
    {
        File tPath = new File(aFile.getParent());
        if(!tPath.exists()) {
            tPath.mkdirs();
        }
    }
View Full Code Here

                setLanguage(null);
                super.workFile(aFile);
                super.deleteTempFiles();
            }
        } else {
            File tTargetFile = new File(computeNewFilePath(aFile));
            ensurePathForFileExists(tTargetFile);
            if(tTargetFile.exists()) {
                tTargetFile.delete();
            }
            try {
                FileUtils.copy(aFile, tTargetFile);
            } catch(IOException e) {
                mErrors++;
View Full Code Here

                        //if file is already a jsp-file, you shouldn't overwrite it!
                        //It is already converted!
                        //So only create the file if it not already exist!
                        //A file isn't created on hard disk with the constructor "new File()".
                        //So you can test if a file exists with file.exists().
                        File tFile = new File (tPath);
                        try {
                            tWriter = new BufferedWriter (new FileWriter (tPath));
                            tWriter.write( tContent);
                        }
                        finally {
View Full Code Here

TOP

Related Classes of KFM.File

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.