Fixed NPE when recursively calculating a folder size with a named pipe
| | |
| | |
|
| | | #### fixes
|
| | |
|
| | | - Fixed nullpointer on recursively calculating folder sizes when there is a named pipe in the hierarchy
|
| | | - Fixed nullpointer on creating a repository with mixed case (issue 185)
|
| | | - Fixed nullpointer when using web.allowForking = true && git.cacheRepositoryList = false (issue 182)
|
| | | - Build project models from the repository model cache, when possible, to reduce page load time (issue 172)
|
| | |
| | | if (directory == null || !directory.exists()) {
|
| | | return -1;
|
| | | }
|
| | | if (directory.isFile()) {
|
| | | return directory.length();
|
| | | }
|
| | | if (directory.isDirectory()) {
|
| | | long length = 0;
|
| | | for (File file : directory.listFiles()) {
|
| | | if (file.isFile()) {
|
| | | length += file.length();
|
| | | } else {
|
| | | length += folderSize(file);
|
| | | }
|
| | | }
|
| | | return length;
|
| | | } else if (directory.isFile()) {
|
| | | return directory.length();
|
| | | }
|
| | | return 0;
|
| | | }
|
| | |
|
| | | /**
|