summaryrefslogtreecommitdiff
path: root/javainstaller2
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2007-07-03 11:03:13 +0000
committerRüdiger Timm <rt@openoffice.org>2007-07-03 11:03:13 +0000
commit40ed1bdcb1ad4b1b950ac296204f28d35d781fa1 (patch)
tree00baf7f7eccdbf4494ba344d993aa429699094eb /javainstaller2
parent35175670536777b969fe4ac0108aaa5d0be2298d (diff)
INTEGRATION: CWS native87 (1.3.2); FILE MERGED
2007/06/01 10:56:33 is 1.3.2.4: #i65425# new Java gui installer 2007/05/30 12:34:34 is 1.3.2.3: #i65425# building javainstaller 2007/04/25 12:24:25 is 1.3.2.2: #i65425# preparing copy of jre 2007/04/24 10:09:31 is 1.3.2.1: #i65425# adding header
Diffstat (limited to 'javainstaller2')
-rwxr-xr-xjavainstaller2/src/JavaSetup/org/openoffice/setup/Util/SystemManager.java50
1 files changed, 47 insertions, 3 deletions
diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/SystemManager.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/SystemManager.java
index 57dedeb0805b..7a0315210079 100755
--- a/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/SystemManager.java
+++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/Util/SystemManager.java
@@ -1,3 +1,38 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: SystemManager.java,v $
+ *
+ * $Revision: 1.4 $
+ *
+ * last change: $Author: rt $ $Date: 2007-07-03 12:03:13 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+
package org.openoffice.setup.Util;
import java.io.BufferedInputStream;
@@ -332,7 +367,7 @@ public class SystemManager {
// put file into buffer
bis = new BufferedInputStream(fis);
bos = new BufferedOutputStream(fos);
- try { // Datei lesen, schreiben und schließen
+ try { // read file, write and close
b = new byte[bis.available()];
bis.read(b);
bos.write(b);
@@ -348,7 +383,7 @@ public class SystemManager {
static public boolean deleteFile(File file) {
boolean success = false;
- if ( file != null ) {
+ if ( file.exists() && file != null ) {
success = file.delete();
}
return success;
@@ -367,7 +402,7 @@ public class SystemManager {
}
static public void removeDirectory(File dir) {
- if ( dir.isDirectory() ) {
+ if ( dir.exists() && dir.isDirectory() ) {
File[] file = dir.listFiles();
if (file != null) {
for (int i = 0; i < file.length; i++) {
@@ -400,6 +435,15 @@ public class SystemManager {
int value = ExecuteProcess.executeProcessReturnValue(commandArray);
}
+ static public void setUnixPrivilegesDirectory(File directoryName, String ext, String unixRights) {
+ File[] file = directoryName.listFiles(new FileExtensionFilter(ext));
+ if (file != null) {
+ for (int i = 0; i < file.length; i++) {
+ setUnixPrivileges(file[i].getPath(), unixRights);
+ }
+ }
+ }
+
static public int calculateDiscSpace(String directory) {
String command = "df -k " + directory;
String[] commandArray = new String[3];