%@ page contentType="text/html; charset=iso-8859-1" language="java" errorPage="" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.lang.*" %>
logged in to the Vault
<%
String filePath="your destination directory goes here/";
String fname="";
String[] argSet1=null;
FileWriter fwOut=null;
String lineBuf="no content";
String lineIn="";
String userName="";
boolean formEntry=false;
int MAXLENGTH=5000;
boolean newAccountState=true;
String statusLine="no login";
if (request.getContentLength()
<%
}
} //end if existing account
if (request.getParameterValues("savePath")!=null) { // must be saving data to server
newAccountState=false;
argSet1= request.getParameterValues("savePath");
fname=argSet1[0];
formEntry=true;
if (request.getParameterValues("text")!=null) {
argSet1= request.getParameterValues("text");;
lineBuf=argSet1[0];
try{
fwOut=new FileWriter(filePath+fname+".ext");
BufferedWriter lineOut = new BufferedWriter(fwOut);
lineOut.write(lineBuf);
lineOut.flush();
lineOut.close();
statusLine="data saved for "+fname;
}catch (Exception e){
formEntry=false;
statusLine="file save error for "+filePath+fname;
}
}
}
if(newAccountState){
try{
BufferedReader isTest = new BufferedReader(new FileReader(filePath+fname+".ext"));
// if there was not an exception, file/account exists...alert and try again
%>
<%
}catch (Exception e){
// 'good' exception...could not open file...go ahead and create a new one
}
try{
fwOut=new FileWriter(filePath+fname+".ext");
BufferedWriter lineOut = new BufferedWriter(fwOut);
lineOut.write("pwProtectfile for "+userName+" >> \n");
lineOut.flush();
lineOut.close();
statusLine="created new account for "+userName;
}catch (Exception e){
formEntry=false;
statusLine="new account creation error for "+filePath+fname+" please email pwp@datacorner.com";
}
}
}
if (!formEntry)
statusLine=("formEntry false >> ")+fname;
%>