|
1 |
| package com.agical.rdoc.core.resourcemanager.impl; |
|
2 |
| |
|
3 |
| import java.io.File; |
|
4 |
| import java.io.IOException; |
|
5 |
| |
|
6 |
| import com.agical.rdoc.core.exception.ResourceNotFoundSystemException; |
|
7 |
| |
|
8 |
| public class SystemPropertiesBasedirProvider implements BasedirProvider { |
|
9 |
| |
|
10 |
12
| public File getBasedir() {
|
|
11 |
12
| try {
|
|
12 |
12
| String basedir = System.getProperty( "basedir", System.getProperty("user.dir") );
|
|
13 |
12
| File canonicalFile = new File( basedir ).getCanonicalFile();
|
|
14 |
12
| return canonicalFile;
|
|
15 |
| } catch (IOException e) { |
|
16 |
0
| throw new ResourceNotFoundSystemException( "Could not find directories for neither user.dir nor basedir." );
|
|
17 |
| } |
|
18 |
| } |
|
19 |
| |
|
20 |
| } |