Commit 08ad9a96 authored by manohar's avatar manohar

folder/file creation should work for both linux and windows


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91212 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 619c4c7d
......@@ -232,7 +232,8 @@ public class TaxInputCrtXmlPrc extends ProcessEJB implements TaxInputCrtXmlPrcLo
dbf = null;
File taxDir = new File( fileName );
File subDirFile = null;
// 19/01/10 manoharan both on linux and windows should work
/*
if( !taxDir.exists() )
{
if(taxInputCerdStr.indexOf("\\") > 0)
......@@ -265,6 +266,45 @@ public class TaxInputCrtXmlPrc extends ProcessEJB implements TaxInputCrtXmlPrcLo
}
subDirFile = null;
}
*/
if( !taxDir.exists() )
{
String subDirName = "";
if (taxInputCerdStr.indexOf("\\") > 0)
{
String subDirs[] = taxInputCerdStr.split( "\\\\" );
subDirName = subDirs[0];
//System.out.println("windows stype path");
for( int idx = 1; idx < subDirs.length; idx++ )
{
subDirName = subDirName + File.separator + subDirs[ idx ];
//System.out.println("subDirs[ idx ] [" + subDirs[ idx ] + "]");
}
}
else
{
String subDirs[] = taxInputCerdStr.split( "/" );
subDirName = subDirs[0];
//System.out.println("Unix style path");
for( int idx = 1; idx < subDirs.length; idx++ )
{
subDirName = subDirName + File.separator + subDirs[ idx ];
//System.out.println("subDirs[ idx ] [" + subDirs[ idx ] + "]");
}
}
subDirFile = new File( subDirName );
//System.out.println("File path [" + subDirName + "]");
if( !subDirFile.exists() )
{
//System.out.println("creating folders [" + subDirName + "]");
subDirFile.mkdir();
}
}
// end 19/01/10 manoharan both on linux and windows should work
FileOutputStream fileOutput = new FileOutputStream(taxDir);
PrintWriter printWriter = new PrintWriter(fileOutput,true);
printWriter.println(xmlBuff.toString());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment