Code example for File

Methods: getParentgetPath

0
      } 
 
      if(null != base)
      { 
        File baseFile = new File(base);
        file = new File(baseFile.getParent(), fileName);
      } 
      // System.out.println("file is: "+file.toString()); 
    } 
 
    if(mkdirs)
    { 
      String dirStr = file.getParent();
      if((null != dirStr) && (dirStr.length() > 0))
      { 
        File dir = new File(dirStr);
        dir.mkdirs();
      } 
    } 
 
    // This should be worked on so that the output format can be  
    // defined by a first child of the redirect element. 
    OutputProperties format = transformer.getOutputFormat();
 
    // FileOutputStream ostream = new FileOutputStream(file); 
    // Patch from above line to below by <jpvdm@iafrica.com> 
    //  Note that in JDK 1.2.2 at least, FileOutputStream(File) 
    //  is implemented as a call to  
    //  FileOutputStream(File.getPath, append), thus this should be  
    //  the equivalent instead of getAbsolutePath() 
    FileOutputStream ostream = new FileOutputStream(file.getPath(), append);
     
    try 
    { 
      SerializationHandler flistener = 
        createSerializationHandler(transformer, ostream, file, format);
Connect your IDE to all the code out there  Get Codota for Java