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-1021
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 |
|
1018 |
/* (non-Javadoc) |
1019 |
/* (non-Javadoc) |
|
|
1020 |
* @see IResource#getPersistentProperties() |
1021 |
*/ |
1022 |
public Map getPersistentProperties() throws CoreException { |
1023 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1024 |
return getPropertyManager().getProperties(this); |
1025 |
} |
1026 |
|
1027 |
/* (non-Javadoc) |
1019 |
* @see IResource#getProject() |
1028 |
* @see IResource#getProject() |
1020 |
*/ |
1029 |
*/ |
1021 |
public IProject getProject() { |
1030 |
public IProject getProject() { |
Lines 1073-1085
Link Here
|
1073 |
* @see IResource#getSessionProperty(QualifiedName) |
1082 |
* @see IResource#getSessionProperty(QualifiedName) |
1074 |
*/ |
1083 |
*/ |
1075 |
public Object getSessionProperty(QualifiedName key) throws CoreException { |
1084 |
public Object getSessionProperty(QualifiedName key) throws CoreException { |
1076 |
ResourceInfo info = getResourceInfo(false, false); |
1085 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1077 |
int flags = getFlags(info); |
|
|
1078 |
checkAccessible(flags); |
1079 |
checkLocal(flags, DEPTH_ZERO); |
1080 |
return info.getSessionProperty(key); |
1086 |
return info.getSessionProperty(key); |
1081 |
} |
1087 |
} |
1082 |
|
1088 |
|
|
|
1089 |
/* (non-Javadoc) |
1090 |
* @see IResource#getSessionProperties() |
1091 |
*/ |
1092 |
public Map getSessionProperties() throws CoreException { |
1093 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1094 |
return info.getSessionProperties(); |
1095 |
} |
1096 |
|
1083 |
public IFileStore getStore() { |
1097 |
public IFileStore getStore() { |
1084 |
return getLocalManager().getStore(this); |
1098 |
return getLocalManager().getStore(this); |
1085 |
} |
1099 |
} |
Lines 1471-1480
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 |
|
Lines 1545-1554
Link Here
|
1545 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1556 |
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 |
1557 |
// 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. |
1558 |
// 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); |
1559 |
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); |
1560 |
return getLocalManager().setLocalTimeStamp(this, info, value); |
1553 |
} |
1561 |
} |
1554 |
|
1562 |
|
Lines 1556-1565
Link Here
|
1556 |
* @see IResource#setPersistentProperty(QualifiedName, String) |
1564 |
* @see IResource#setPersistentProperty(QualifiedName, String) |
1557 |
*/ |
1565 |
*/ |
1558 |
public void setPersistentProperty(QualifiedName key, String value) throws CoreException { |
1566 |
public void setPersistentProperty(QualifiedName key, String value) throws CoreException { |
1559 |
ResourceInfo info = getResourceInfo(false, false); |
1567 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1560 |
int flags = getFlags(info); |
|
|
1561 |
checkAccessible(flags); |
1562 |
checkLocal(flags, DEPTH_ZERO); |
1563 |
getPropertyManager().setProperty(this, key, value); |
1568 |
getPropertyManager().setProperty(this, key, value); |
1564 |
} |
1569 |
} |
1565 |
|
1570 |
|
Lines 1583-1592
Link Here
|
1583 |
* @see org.eclipse.core.resources.IResource#setResourceAttributes(org.eclipse.core.resources.ResourceAttributes) |
1588 |
* @see org.eclipse.core.resources.IResource#setResourceAttributes(org.eclipse.core.resources.ResourceAttributes) |
1584 |
*/ |
1589 |
*/ |
1585 |
public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { |
1590 |
public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { |
1586 |
ResourceInfo info = getResourceInfo(false, false); |
1591 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1587 |
int flags = getFlags(info); |
|
|
1588 |
checkAccessible(flags); |
1589 |
checkLocal(flags, DEPTH_ZERO); |
1590 |
getLocalManager().setResourceAttributes(this, attributes); |
1592 |
getLocalManager().setResourceAttributes(this, attributes); |
1591 |
} |
1593 |
} |
1592 |
|
1594 |
|
Lines 1597-1606
Link Here
|
1597 |
// fetch the info but don't bother making it mutable even though we are going |
1599 |
// 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 |
1600 |
// 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. |
1601 |
// matter as the change we are doing does not show up in deltas. |
1600 |
ResourceInfo info = getResourceInfo(false, false); |
1602 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1601 |
int flags = getFlags(info); |
|
|
1602 |
checkAccessible(flags); |
1603 |
checkLocal(flags, DEPTH_ZERO); |
1604 |
info.setSessionProperty(key, value); |
1603 |
info.setSessionProperty(key, value); |
1605 |
} |
1604 |
} |
1606 |
|
1605 |
|
Lines 1650-1659
Link Here
|
1650 |
final ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this); |
1649 |
final ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this); |
1651 |
try { |
1650 |
try { |
1652 |
workspace.prepareOperation(rule, monitor); |
1651 |
workspace.prepareOperation(rule, monitor); |
1653 |
ResourceInfo info = getResourceInfo(false, false); |
1652 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1654 |
int flags = getFlags(info); |
|
|
1655 |
checkAccessible(flags); |
1656 |
checkLocal(flags, DEPTH_ZERO); |
1657 |
|
1653 |
|
1658 |
workspace.beginOperation(true); |
1654 |
workspace.beginOperation(true); |
1659 |
// fake a change by incrementing the content ID |
1655 |
// fake a change by incrementing the content ID |