File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/main/java/com/nordstrom/common/file Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 33import java .io .BufferedReader ;
44import java .io .File ;
55import java .io .IOException ;
6+ import java .io .InputStream ;
67import java .io .InputStreamReader ;
78import java .util .HashMap ;
89import java .util .Map ;
@@ -20,18 +21,21 @@ private VolumeInfo() {
2021 }
2122
2223 public static Map <String , VolumeProps > getVolumeProps () throws IOException {
23- Map <String , VolumeProps > propsList = new HashMap <>();
24- Pattern template = Pattern .compile ("(.+) on (.+) type (.+) \\ ((.+)\\ )" );
25-
2624 Process mountProcess ;
2725 if (IS_WINDOWS ) {
2826 String [] cmd = {"sh" , "-c" , "mount | grep noumount" };
2927 mountProcess = Runtime .getRuntime ().exec (cmd );
3028 } else {
3129 mountProcess = Runtime .getRuntime ().exec ("mount" );
3230 }
31+ return getVolumeProps (mountProcess .getInputStream ());
32+ }
33+
34+ public static Map <String , VolumeProps > getVolumeProps (InputStream is ) throws IOException {
35+ Map <String , VolumeProps > propsList = new HashMap <>();
36+ Pattern template = Pattern .compile ("(.+) on (.+) type (.+) \\ ((.+)\\ )" );
3337
34- InputStreamReader isr = new InputStreamReader (mountProcess . getInputStream () );
38+ InputStreamReader isr = new InputStreamReader (is );
3539 try (BufferedReader mountOutput = new BufferedReader (isr )) {
3640 String line ;
3741 while (null != (line = mountOutput .readLine ())) {
You can’t perform that action at this time.
0 commit comments