Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 290290
Collapse All | Expand All

(-)miners/org/eclipse/rse/internal/dstore/universal/miners/filesystem/CopyThread.java (-2 / +35 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others.
2
 * Copyright (c) 2007, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 12-17 Link Here
12
 * Contributors:
12
 * Contributors:
13
 * Xuan Chen (IBM) - [209827] Update DStore command implementation to enable cancelation of archive operations
13
 * Xuan Chen (IBM) - [209827] Update DStore command implementation to enable cancelation of archive operations
14
 * Noriaki Takatsu (IBM)  - [220126] [dstore][api][breaking] Single process server for multiple clients
14
 * Noriaki Takatsu (IBM)  - [220126] [dstore][api][breaking] Single process server for multiple clients
15
 * David McKnight  (IBM)  - [290290] [dstore] Error message when copy a file from another user’s folder
15
 *******************************************************************************/
16
 *******************************************************************************/
16
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
17
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
17
18
Lines 20-25 Link Here
20
21
21
import org.eclipse.dstore.core.model.DE;
22
import org.eclipse.dstore.core.model.DE;
22
import org.eclipse.dstore.core.model.DataElement;
23
import org.eclipse.dstore.core.model.DataElement;
24
import org.eclipse.dstore.core.server.SecuredThread;
23
import org.eclipse.rse.dstore.universal.miners.ICancellableHandler;
25
import org.eclipse.rse.dstore.universal.miners.ICancellableHandler;
24
import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
26
import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants;
25
import org.eclipse.rse.dstore.universal.miners.UniversalFileSystemMiner;
27
import org.eclipse.rse.dstore.universal.miners.UniversalFileSystemMiner;
Lines 27-33 Link Here
27
import org.eclipse.rse.services.clientserver.IServiceConstants;
29
import org.eclipse.rse.services.clientserver.IServiceConstants;
28
import org.eclipse.rse.services.clientserver.PathUtility;
30
import org.eclipse.rse.services.clientserver.PathUtility;
29
import org.eclipse.rse.services.clientserver.SystemOperationMonitor;
31
import org.eclipse.rse.services.clientserver.SystemOperationMonitor;
30
import org.eclipse.dstore.core.server.SecuredThread;
31
32
32
public class CopyThread extends SecuredThread implements ICancellableHandler {
33
public class CopyThread extends SecuredThread implements ICancellableHandler {
33
34
Lines 200-205 Link Here
200
					    err = err.substring(0, err.length() - newLine.length());
201
					    err = err.substring(0, err.length() - newLine.length());
201
					}
202
					}
202
					
203
					
204
					String theOS = System.getProperty("os.name"); //$NON-NLS-1$
205
					boolean isZ = theOS.toLowerCase().startsWith("z"); //$NON-NLS-1$
206
					
207
					// special case for bug 290290 - which only occurs on z/OS
208
					if (isZ && err.startsWith("cp: FSUM8985")){ //$NON-NLS-1$
209
						// attempt against without the -p
210
						if (folderCopy) {
211
							command = "cp  -R " + source + " " + tgt; //$NON-NLS-1$ //$NON-NLS-2$
212
						}
213
						else {
214
							command = "cp " + source + " " + tgt; //$NON-NLS-1$ //$NON-NLS-2$
215
						}
216
						String theShell = "sh"; //$NON-NLS-1$
217
						String args[] = new String[3];
218
						args[0] = theShell;					
219
						args[1] = "-c"; //$NON-NLS-1$
220
						args[2] = command;
221
														
222
						p = runtime.exec(args);
223
						
224
					    // wait for process to finish
225
					    p.waitFor();
226
					    
227
					    // get the exit value of the process
228
					   result = p.exitValue();
229
					    
230
					    // if the exit value is not 0, then the process did not terminate normally
231
					    if (result == 0) {
232
					    	status.setAttribute(DE.A_SOURCE, IServiceConstants.SUCCESS);
233
					    	return;
234
					    }
235
					}
203
					// if there is something in error buffer
236
					// if there is something in error buffer
204
					// there was something in the error stream of the process
237
					// there was something in the error stream of the process
205
					if (err.length() > 0) {
238
					if (err.length() > 0) {

Return to bug 290290