Demos and Usage of java.io.File.getParentFile()


   1:     private static ClassLoader toolsClassLoader() {
   2:     File javaHome   = new File(System.getProperty("java.home"));
   3:         ...
   4:     File classesDir = new File(javaHome, "classes");
   5:         ...
   6:     File libDir     = new File(javaHome.getParentFile(), "lib");
   7:     File toolsJar   = new File(libDir, "tools.jar");

View Full Code Here
   1: 
   2: import java.io.File;
   3: 
   4:         ...
   5:         
   6:         File tmpFile = File.createTempFile("prefix", "postfix");
   7:         tmpFile.deleteOnExit();
   8:         ...
   9:         File dir = new File(tmpFile.getParentFile(), "subdir");
  10:         dir.mkdir();
  11:         ...
  12:         tmpFile.deleteOnExit();
  13:         File dir = new File(tmpFile.getParentFile(), "subdir");

View Full Code Here
   1: import java.io.BufferedWriter;
   2: import java.io.File;
   3: import java.io.FileOutputStream;
   4:         ...
   5: 
   6:     private File infile;
   7: 
   8:         ...
   9:     public RegExpHelper(String infile) {
  10:         this.infile = new File(infile);
  11:     }
  12:         ...
  13:     private void escapeFile() throws IOException {
  14:         File outFile = new File(infile.getParentFile(), "build.golden.regexp");

View Full Code Here
   1: 
   2: import java.io.File;
   3: import java.io.FileInputStream;
   4:         ...
   5:         
   6:         File f = new File(platformXML.getFile());
   7: 
   8:         try {
   9:             if (!f.exists()) {

View Full Code Here
   1:     private Map<String, Setting> settingMap;
   2:     private File prefFile;
   3:     private Properties valueProperties;
   4:         ...
   5:     
   6:     public Preferences( File file )
   7:     {
   8:         ...
   9:             }
  10:             File bakFile = new File( prefFile.getParentFile(),
  11:                 prefFile.getName() + ".bak" );
  12:         ...
  13:         
  14:         File bakFile = new File( prefFile.getParentFile(), prefFile.getName() + ".bak" );

View Full Code Here
   1: 
   2: import java.io.File;
   3: import java.io.FileInputStream;
   4:         ...
   5:         String dest = args[1];
   6:         File srcFile = new File(src);
   7:         if (!srcFile.exists()) {
   8:         ...
   9:         if ("Class.js".equals(srcFile.getName())) {
  10:             source += RegExCompress.readFileAll(new FileInputStream(new File(srcFile.getParentFile(), "ClassExt.js")));
  11:         }

View Full Code Here
   1: import java.awt.event.ActionEvent;
   2: import java.io.File;
   3: import java.io.FileNotFoundException;
   4:         ...
   5:             if (fn.length() > 0) {
   6:                 chooser.setSelectedFile(new File(fn));
   7:             }
   8:         ...
   9:             if (retval == JFileChooser.APPROVE_OPTION) {
  10:                 File theFile = chooser.getSelectedFile();
  11:                 if (theFile != null) {
  12:         ...
  13: 
  14:                     theFile = new File(theFile.getParentFile(),

View Full Code Here
   1: 
   2: import java.io.File;
   3: import java.io.FileInputStream;
   4:         ...
   5:                 log.debug("name:" + name);
   6:                 File uploadedFile = mpr.getFile(name);
   7:                 if (uploadedFile == null || uploadedFile.length() == 0)
   8:         ...
   9:                 {
  10:                     log.error("No file found in multipart request");
  11:                     return "input";
  12:         ...
  13:                 
  14:                 File file = new File(uploadedFile.getParentFile(), "tmp" + System.currentTimeMillis());

View Full Code Here
   1: 
   2: import java.io.File;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     public static Drawing loadDrawing(File file, StatusDisplayer sd) {
   7:         PositionedDrawing posDrawing = loadPositionedDrawing(file, sd);
   8:         ...
   9:             if (!ff.accept(file)) {
  10:                 result = new File(file.getParentFile(),
  11:                                   file.getName() + "." + ff.getExtension());

View Full Code Here
   1: 
   2: import java.io.File;
   3: import java.net.URL;
   4:         ...
   5:             
   6:             File f = new File(policy);
   7:             
   8:         ...
   9:             
  10:             File jks = new File( f.getParentFile(), "jspwiki.jks" );
  11:             
  12:         ...
  13:                          "needs to be done.  If you keep having access right permissions, please try "+
  14:                          "copying your WEB-INF/jspwiki.jks to "+f.getParentFile().getAbsolutePath() );

View Full Code Here
   1:     
   2:     File currentFile = null;
   3: 
   4:         ...
   5:                     javax.swing.filechooser.FileFilter filter_ = new javax.swing.filechooser.FileFilter() {
   6:                         public boolean accept(File f_)
   7:                         { return f_.isDirectory() || f_.getName().endsWith(".tcl"); }
   8:         ...
   9:         mBar = new JMenuBar();
  10:         mFile = new JMenu("File");
  11:         mFile.setMnemonic(KeyEvent.VK_F);
  12:         ...
  13:         }
  14:         chooser.setCurrentDirectory(currentFile == null? new File("."): currentFile.getParentFile());

View Full Code Here
   1: 
   2:     public Identity(File file, PublicKey vKey, boolean allowSelfSigned) throws IOException {
   3:         RandomAccessFile raf = null;
   4:         ...
   5:         try {
   6:             raf = new RandomAccessFile(file, "r");
   7: 
   8:         ...
   9: 
  10:                 File tmpfile = new File(file.getParentFile(),
  11:                         file.getName()+".puzzle");

View Full Code Here
   1: import java.awt.geom.Rectangle2D;
   2: import java.io.File;
   3: import java.io.IOException;
   4:         ...
   5: 
   6:     private File inputLocation;
   7: 
   8:         ...
   9:     private File outputLocation;
  10: 
  11:         ...
  12:             else
  13:                 outputLocation = new File(inputLocation.getParentFile(),

View Full Code Here
   1: import java.awt.event.MouseEvent;
   2: import java.io.File;
   3: import java.io.FileInputStream;
   4:         ...
   5:     protected int numPackages;
   6:     protected File location;
   7:     protected JTextField tfLoc;
   8:         ...
   9: 
  10:         if (File.separatorChar == '/') os = "Unix";
  11:         else if (File.separatorChar == '\\') os = "Windows";
  12:         ...
  13:         location = new File(tfLoc.getText());
  14:         if (!location.isDirectory()) location = new File(location.getParentFile(), "jsynoptic");

View Full Code Here
   1: import java.io.BufferedInputStream;
   2: import java.io.File;
   3: import java.io.FileInputStream;
   4:         ...
   5: 
   6:     private File sourceFile;
   7: 
   8:         ...
   9: 
  10:         if (source instanceof File)
  11:             this.sourceFile = ((File) source);
  12:         ...
  13:                 final String levelDirName = levelsDirs[imageChoice.intValue()];
  14:                 final File parentDir = new File(sourceFile.getParentFile(),

View Full Code Here