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 131105 | Differences between
and this patch

Collapse All | Expand All

(-)extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java (-36 / +2 lines)
Lines 1374-1383 Link Here
1374
		if (!isAccessible(destination)) {
1374
		if (!isAccessible(destination)) {
1375
			return IDEWorkbenchMessages.CopyFilesAndFoldersOperation_destinationAccessError;
1375
			return IDEWorkbenchMessages.CopyFilesAndFoldersOperation_destinationAccessError;
1376
		}
1376
		}
1377
		String destinationMessage = validateDestinationLocation(destination);
1378
		if (destinationMessage != null) {
1379
			return destinationMessage;
1380
		}
1381
		IContainer firstParent = null;
1377
		IContainer firstParent = null;
1382
		URI destinationLocation = destination.getLocationURI();
1378
		URI destinationLocation = destination.getLocationURI();
1383
		for (int i = 0; i < sourceResources.length; i++) {
1379
		for (int i = 0; i < sourceResources.length; i++) {
Lines 1426-1457 Link Here
1426
		return null;
1422
		return null;
1427
	}
1423
	}
1428
1424
1429
	/**
1430
	 * Validates whether the destination location exists. Linked resources
1431
	 * created on undefined path variables have an undefined location.
1432
	 * 
1433
	 * @param destination
1434
	 *            destination container
1435
	 * @return error message or null if destination location is valid (non-<code>null</code>)
1436
	 */
1437
	private String validateDestinationLocation(IContainer destination) {
1438
		IPath destinationLocation = destination.getLocation();
1439
1440
		if (destinationLocation == null) {
1441
			if (destination.isLinked()) {
1442
				return NLS
1443
						.bind(
1444
								IDEWorkbenchMessages.CopyFilesAndFoldersOperation_missingPathVariable,
1445
								destination.getName());
1446
			}
1447
			return NLS
1448
					.bind(
1449
							IDEWorkbenchMessages.CopyFilesAndFoldersOperation_resourceDeleted,
1450
							destination.getName());
1451
1452
		}
1453
		return null;
1454
	}
1455
1425
1456
	/**
1426
	/**
1457
	 * Validates that the given source resources can be copied to the
1427
	 * Validates that the given source resources can be copied to the
Lines 1534-1546 Link Here
1534
	 */
1504
	 */
1535
	private String validateImportDestinationInternal(IContainer destination,
1505
	private String validateImportDestinationInternal(IContainer destination,
1536
			IFileStore[] sourceStores) {
1506
			IFileStore[] sourceStores) {
1537
		if (!isAccessible(destination)) {
1507
		if (!isAccessible(destination)) 
1538
			return IDEWorkbenchMessages.CopyFilesAndFoldersOperation_destinationAccessError;
1508
			return IDEWorkbenchMessages.CopyFilesAndFoldersOperation_destinationAccessError;
1539
		}
1509
		
1540
		String destinationMessage = validateDestinationLocation(destination);
1541
		if (destinationMessage != null) {
1542
			return destinationMessage;
1543
		}
1544
1510
1545
		IFileStore destinationStore;
1511
		IFileStore destinationStore;
1546
		try {
1512
		try {

Return to bug 131105