File tempFile;
    public synchronized void sfDeploy() throws SmartFrogException, RemoteException {        super.sfDeploy();        String prefix = sfResolve(ATTR_PREFIX, "", true);        if(prefix.length()==0) {            throw new SmartFrogException(ERROR_PREFIX_EMPTY,this);        }        String suffix = sfResolve(ATTR_SUFFIX, (String) null, false);        String dir;        dir=FileSystem.lookupAbsolutePath(this,ATTR_DIRECTORY,null,null,false,null);        String text = sfResolve(ATTR_TEXT, (String) null, false);        if (sfLog().isDebugEnabled()){            sfLog().debug("Creating temp file in dir ["+dir+"], prefix="+prefix                           +", suffix="+suffix+", text="+text);        }        File tempFile;        try {            if (dir == null) {                tempFile = File.createTempFile(prefix, suffix);            } else {                File directory = new File(dir);                directory.mkdirs();                tempFile = File.createTempFile(prefix, suffix, directory);            }        } catch (IOException e) {            throw SmartFrogException.forward(e);        }        //Create File content if needed        if (text!=null) {            String encoding = null;            encoding = sfResolve(ATTR_TEXT_ENCODING, (String)null, true);            Writer wout = null;            try {                OutputStream fout;                fout = new FileOutputStream(getFile());                wout = new OutputStreamWriter(fout, encoding);                wout.write(text);                wout.flush();                wout.close();            } catch (IOException ioe) {                if (wout!=null) {                    try {                        wout.close();                    } catch (IOException ignored) {                        //ignore this                    }                }                throw SmartFrogException.forward("When trying to write to "+ getFile(),ioe);            }        }        //bind to the temp file        bind(tempFile);        sfReplaceAttribute(FileUsingComponent.ATTR_FILENAME, tempFile.toString());    }