Java Desktop Directory getDesktopDirectory()

Here you can find the source of getDesktopDirectory()

Description

get Desktop Directory

License

BSD License

Return

on a Windows System, the user's Desktop Directory

Declaration

public static File getDesktopDirectory() 

Method Source Code

//package com.java2s;
/**/*from w ww  . j  av a 2s  .  c  om*/
 * <p>
 * Utilities for manipulating Paths, Files, Directories, etc.
 * </p>
 * <p>
 * <span class="BSDLicense"> This software is distributed under the <a
 * href="http://hci.stanford.edu/research/copyright.txt">BSD License</a>.</span>
 * </p>
 * 
 * @author <a href="http://graphics.stanford.edu/~ronyeh">Ron B Yeh</a> (ronyeh(AT)cs.stanford.edu)
 */

import java.io.File;

import javax.swing.filechooser.FileSystemView;

public class Main {
    /**
     * @return on a Windows System, the user's Desktop Directory
     */
    public static File getDesktopDirectory() {
        return FileSystemView.getFileSystemView().getHomeDirectory();
    }
}

Related

  1. desktopDirectory()