initial commit
[svjatoslav_commons.git] / src / main / java / eu / svjatoslav / commons / file / CommonPathResolver.java
1 /*
2  * Svjatoslav Commons - shared library of common functionality.
3  * Copyright (C) 2012, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of version 2 of the GNU General Public License
7  * as published by the Free Software Foundation.
8  */
9
10 package eu.svjatoslav.commons.file;
11
12 import java.io.File;
13
14 public class CommonPathResolver {
15
16         public static File getDesktopDirectory() {
17                 String desktopPath = System.getProperty("user.home") + "/Desktop";
18
19                 File desktopFile = new File(desktopPath);
20                 if (desktopFile.exists())
21                         return desktopFile;
22
23                 desktopPath = System.getProperty("user.home") + "/Рабочий стол";
24
25                 desktopFile = new File(desktopPath);
26                 if (desktopFile.exists())
27                         return desktopFile;
28
29                 return null;
30         }
31
32         public static File getHomeDirectory() {
33                 return new File(System.getProperty("user.home"));
34         }
35
36 }