Lines 192-197
Link Here
|
192 |
checkExists(flags, true); |
192 |
checkExists(flags, true); |
193 |
} |
193 |
} |
194 |
|
194 |
|
|
|
195 |
protected ResourceInfo checkAccessibleAndLocal(int depth) throws CoreException { |
196 |
ResourceInfo info = getResourceInfo(false, false); |
197 |
int flags = getFlags(info); |
198 |
checkAccessible(flags); |
199 |
checkLocal(flags, depth); |
200 |
return info; |
201 |
} |
202 |
|
195 |
/** |
203 |
/** |
196 |
* This method reports errors in two different ways. It can throw a |
204 |
* This method reports errors in two different ways. It can throw a |
197 |
* CoreException or return a status. CoreExceptions are used according to the |
205 |
* CoreException or return a status. CoreExceptions are used according to the |
Lines 218-228
Link Here
|
218 |
} |
226 |
} |
219 |
checkValidPath(destination, destinationType, false); |
227 |
checkValidPath(destination, destinationType, false); |
220 |
|
228 |
|
221 |
ResourceInfo info = getResourceInfo(false, false); |
229 |
ResourceInfo info; |
222 |
int flags = getFlags(info); |
230 |
checkAccessibleAndLocal(DEPTH_INFINITE); |
223 |
checkAccessible(flags); |
231 |
|
224 |
checkLocal(flags, DEPTH_INFINITE); |
|
|
225 |
|
226 |
Resource dest = workspace.newResource(destination, destinationType); |
232 |
Resource dest = workspace.newResource(destination, destinationType); |
227 |
dest.checkDoesNotExist(); |
233 |
dest.checkDoesNotExist(); |
228 |
|
234 |
|
Lines 350-359
Link Here
|
350 |
} |
356 |
} |
351 |
checkValidPath(destination, destinationType, false); |
357 |
checkValidPath(destination, destinationType, false); |
352 |
|
358 |
|
353 |
ResourceInfo info = getResourceInfo(false, false); |
359 |
ResourceInfo info; |
354 |
int flags = getFlags(info); |
360 |
checkAccessibleAndLocal(DEPTH_INFINITE); |
355 |
checkAccessible(flags); |
|
|
356 |
checkLocal(flags, DEPTH_INFINITE); |
357 |
|
361 |
|
358 |
Resource dest = workspace.newResource(destination, destinationType); |
362 |
Resource dest = workspace.newResource(destination, destinationType); |
359 |
|
363 |
|
Lines 1008-1017
Link Here
|
1008 |
* @see IResource#getPersistentProperty(QualifiedName) |
1012 |
* @see IResource#getPersistentProperty(QualifiedName) |
1009 |
*/ |
1013 |
*/ |
1010 |
public String getPersistentProperty(QualifiedName key) throws CoreException { |
1014 |
public String getPersistentProperty(QualifiedName key) throws CoreException { |
1011 |
ResourceInfo info = getResourceInfo(false, false); |
1015 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1012 |
int flags = getFlags(info); |
|
|
1013 |
checkAccessible(flags); |
1014 |
checkLocal(flags, DEPTH_ZERO); |
1015 |
return getPropertyManager().getProperty(this, key); |
1016 |
return getPropertyManager().getProperty(this, key); |
1016 |
} |
1017 |
} |
1017 |
|
1018 |
|
Lines 1073-1082
Link Here
|
1073 |
* @see IResource#getSessionProperty(QualifiedName) |
1074 |
* @see IResource#getSessionProperty(QualifiedName) |
1074 |
*/ |
1075 |
*/ |
1075 |
public Object getSessionProperty(QualifiedName key) throws CoreException { |
1076 |
public Object getSessionProperty(QualifiedName key) throws CoreException { |
1076 |
ResourceInfo info = getResourceInfo(false, false); |
1077 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1077 |
int flags = getFlags(info); |
|
|
1078 |
checkAccessible(flags); |
1079 |
checkLocal(flags, DEPTH_ZERO); |
1080 |
return info.getSessionProperty(key); |
1078 |
return info.getSessionProperty(key); |
1081 |
} |
1079 |
} |
1082 |
|
1080 |
|
Lines 1450-1455
Link Here
|
1450 |
} |
1448 |
} |
1451 |
|
1449 |
|
1452 |
/* (non-Javadoc) |
1450 |
/* (non-Javadoc) |
|
|
1451 |
* @see IResource#removeDeletedPersistentProperties |
1452 |
*/ |
1453 |
public void removeDeletedPersistentProperties() throws CoreException { |
1454 |
// The resource is deleted when this is called |
1455 |
getPropertyManager().removeDeletedProperties(this); |
1456 |
} |
1457 |
|
1458 |
/* (non-Javadoc) |
1453 |
* Method declared on {@link IPathRequestor}. |
1459 |
* Method declared on {@link IPathRequestor}. |
1454 |
*/ |
1460 |
*/ |
1455 |
public String requestName() { |
1461 |
public String requestName() { |
Lines 1464-1469
Link Here
|
1464 |
} |
1470 |
} |
1465 |
|
1471 |
|
1466 |
/* (non-Javadoc) |
1472 |
/* (non-Javadoc) |
|
|
1473 |
* @see IResource#restorePersistentPropertiesFromDeleted() |
1474 |
*/ |
1475 |
public void restorePersistentPropertiesFromDeleted() throws CoreException { |
1476 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1477 |
getPropertyManager().restorePropertiesFromDeleted(this); |
1478 |
} |
1479 |
|
1480 |
/* (non-Javadoc) |
1467 |
* @see IResource#revertModificationStamp |
1481 |
* @see IResource#revertModificationStamp |
1468 |
*/ |
1482 |
*/ |
1469 |
public void revertModificationStamp(long value) throws CoreException { |
1483 |
public void revertModificationStamp(long value) throws CoreException { |
Lines 1471-1484
Link Here
|
1471 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1485 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1472 |
// fetch the info but don't bother making it mutable even though we are going |
1486 |
// fetch the info but don't bother making it mutable even though we are going |
1473 |
// to modify it. It really doesn't matter as the change we are doing does not show up in deltas. |
1487 |
// to modify it. It really doesn't matter as the change we are doing does not show up in deltas. |
1474 |
ResourceInfo info = getResourceInfo(false, false); |
1488 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1475 |
int flags = getFlags(info); |
|
|
1476 |
checkAccessible(flags); |
1477 |
checkLocal(flags, DEPTH_ZERO); |
1478 |
info.setModificationStamp(value); |
1489 |
info.setModificationStamp(value); |
1479 |
} |
1490 |
} |
1480 |
|
1491 |
|
1481 |
/* (non-Javadoc) |
1492 |
/* (non-Javadoc) |
|
|
1493 |
* @see IResource#savePersistentPropertiesAsDeleted() |
1494 |
*/ |
1495 |
public void savePersistentPropertiesAsDeleted() throws CoreException { |
1496 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1497 |
getPropertyManager().savePropertiesAsDeleted(this); |
1498 |
} |
1499 |
|
1500 |
/* (non-Javadoc) |
1482 |
* @see IResource#setDerived(boolean) |
1501 |
* @see IResource#setDerived(boolean) |
1483 |
*/ |
1502 |
*/ |
1484 |
public void setDerived(boolean isDerived) throws CoreException { |
1503 |
public void setDerived(boolean isDerived) throws CoreException { |
Lines 1545-1554
Link Here
|
1545 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1564 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1546 |
// fetch the info but don't bother making it mutable even though we are going |
1565 |
// fetch the info but don't bother making it mutable even though we are going |
1547 |
// to modify it. It really doesn't matter as the change we are doing does not show up in deltas. |
1566 |
// to modify it. It really doesn't matter as the change we are doing does not show up in deltas. |
1548 |
ResourceInfo info = getResourceInfo(false, false); |
1567 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1549 |
int flags = getFlags(info); |
|
|
1550 |
checkAccessible(flags); |
1551 |
checkLocal(flags, DEPTH_ZERO); |
1552 |
return getLocalManager().setLocalTimeStamp(this, info, value); |
1568 |
return getLocalManager().setLocalTimeStamp(this, info, value); |
1553 |
} |
1569 |
} |
1554 |
|
1570 |
|
Lines 1556-1565
Link Here
|
1556 |
* @see IResource#setPersistentProperty(QualifiedName, String) |
1572 |
* @see IResource#setPersistentProperty(QualifiedName, String) |
1557 |
*/ |
1573 |
*/ |
1558 |
public void setPersistentProperty(QualifiedName key, String value) throws CoreException { |
1574 |
public void setPersistentProperty(QualifiedName key, String value) throws CoreException { |
1559 |
ResourceInfo info = getResourceInfo(false, false); |
1575 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1560 |
int flags = getFlags(info); |
|
|
1561 |
checkAccessible(flags); |
1562 |
checkLocal(flags, DEPTH_ZERO); |
1563 |
getPropertyManager().setProperty(this, key, value); |
1576 |
getPropertyManager().setProperty(this, key, value); |
1564 |
} |
1577 |
} |
1565 |
|
1578 |
|
Lines 1583-1592
Link Here
|
1583 |
* @see org.eclipse.core.resources.IResource#setResourceAttributes(org.eclipse.core.resources.ResourceAttributes) |
1596 |
* @see org.eclipse.core.resources.IResource#setResourceAttributes(org.eclipse.core.resources.ResourceAttributes) |
1584 |
*/ |
1597 |
*/ |
1585 |
public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { |
1598 |
public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { |
1586 |
ResourceInfo info = getResourceInfo(false, false); |
1599 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1587 |
int flags = getFlags(info); |
|
|
1588 |
checkAccessible(flags); |
1589 |
checkLocal(flags, DEPTH_ZERO); |
1590 |
getLocalManager().setResourceAttributes(this, attributes); |
1600 |
getLocalManager().setResourceAttributes(this, attributes); |
1591 |
} |
1601 |
} |
1592 |
|
1602 |
|
Lines 1597-1606
Link Here
|
1597 |
// fetch the info but don't bother making it mutable even though we are going |
1607 |
// fetch the info but don't bother making it mutable even though we are going |
1598 |
// to modify it. We don't know whether or not the tree is open and it really doesn't |
1608 |
// to modify it. We don't know whether or not the tree is open and it really doesn't |
1599 |
// matter as the change we are doing does not show up in deltas. |
1609 |
// matter as the change we are doing does not show up in deltas. |
1600 |
ResourceInfo info = getResourceInfo(false, false); |
1610 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1601 |
int flags = getFlags(info); |
|
|
1602 |
checkAccessible(flags); |
1603 |
checkLocal(flags, DEPTH_ZERO); |
1604 |
info.setSessionProperty(key, value); |
1611 |
info.setSessionProperty(key, value); |
1605 |
} |
1612 |
} |
1606 |
|
1613 |
|
Lines 1650-1659
Link Here
|
1650 |
final ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this); |
1657 |
final ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this); |
1651 |
try { |
1658 |
try { |
1652 |
workspace.prepareOperation(rule, monitor); |
1659 |
workspace.prepareOperation(rule, monitor); |
1653 |
ResourceInfo info = getResourceInfo(false, false); |
1660 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1654 |
int flags = getFlags(info); |
|
|
1655 |
checkAccessible(flags); |
1656 |
checkLocal(flags, DEPTH_ZERO); |
1657 |
|
1661 |
|
1658 |
workspace.beginOperation(true); |
1662 |
workspace.beginOperation(true); |
1659 |
// fake a change by incrementing the content ID |
1663 |
// fake a change by incrementing the content ID |