equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
49 |
49 |
50 private static final String name = System.getProperty("os.name"); |
50 private static final String name = System.getProperty("os.name"); |
51 private static final String dfFormat; |
51 private static final String dfFormat; |
52 static { |
52 static { |
53 if (name.equals("SunOS") || name.equals("Linux") |
53 if (name.equals("SunOS") || name.equals("Linux") |
54 || name.startsWith("Mac OS")) { |
54 || name.contains("OS X")) { |
55 // FileSystem Total Used Available Use% MountedOn |
55 // FileSystem Total Used Available Use% MountedOn |
56 dfFormat = "([^\\s]+)\\s+(\\d+)\\s+\\d+\\s+(\\d+)\\s+\\d+%\\s+([^\\s]+)"; |
56 dfFormat = "([^\\s]+)\\s+(\\d+)\\s+\\d+\\s+(\\d+)\\s+\\d+%\\s+([^\\s]+)"; |
57 } else if (name.startsWith("Windows")) { |
57 } else if (name.startsWith("Windows")) { |
58 // Drive (MountedOn) Available/Total |
58 // Drive (MountedOn) Available/Total |
59 dfFormat = "([^\\s]+)\\s+\\(([^\\s]+)\\)\\s+(\\d+)\\/(\\d+)\\s+"; |
59 dfFormat = "([^\\s]+)\\s+\\(([^\\s]+)\\)\\s+(\\d+)\\/(\\d+)\\s+"; |