Clover icon

sunshower-core

  1. Project Clover database Fri Apr 6 2018 03:27:42 UTC
  2. Package io.sunshower.service.revision.model

File Repositories.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart0.png
60% of files have more coverage

Code metrics

6
14
1
1
33
27
5
0.36
14
1
5

Classes

Class Line # Actions
Repositories 8 14 5
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    package io.sunshower.service.revision.model;
2   
3    import io.sunshower.io.Files;
4    import io.sunshower.model.core.io.File;
5    import java.io.IOException;
6   
7    /** Created by haswell on 5/30/17. */
 
8    public class Repositories {
9   
 
10  0 toggle public static boolean delete(Repository repository) {
11   
12  0 final Local local = repository.getLocal();
13  0 if (local == null) {
14  0 return false;
15    }
16  0 File file = local.getFile();
17  0 if (file == null) {
18  0 return false;
19    }
20  0 String path = file.getPath();
21  0 if (path == null) {
22  0 return false;
23    }
24   
25  0 final java.io.File physicalFile = new java.io.File(path);
26  0 try {
27  0 Files.delete(physicalFile);
28  0 return true;
29    } catch (IOException e) {
30  0 return false;
31    }
32    }
33    }