Lines 192-197
Link Here
|
192 |
checkExists(flags, true); |
192 |
checkExists(flags, true); |
193 |
} |
193 |
} |
194 |
|
194 |
|
|
|
195 |
private 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 1032-1045
Link Here
|
1032 |
* @see IResource#getPersistentProperty(QualifiedName) |
1036 |
* @see IResource#getPersistentProperty(QualifiedName) |
1033 |
*/ |
1037 |
*/ |
1034 |
public String getPersistentProperty(QualifiedName key) throws CoreException { |
1038 |
public String getPersistentProperty(QualifiedName key) throws CoreException { |
1035 |
ResourceInfo info = getResourceInfo(false, false); |
1039 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1036 |
int flags = getFlags(info); |
|
|
1037 |
checkAccessible(flags); |
1038 |
checkLocal(flags, DEPTH_ZERO); |
1039 |
return getPropertyManager().getProperty(this, key); |
1040 |
return getPropertyManager().getProperty(this, key); |
1040 |
} |
1041 |
} |
1041 |
|
1042 |
|
1042 |
/* (non-Javadoc) |
1043 |
/* (non-Javadoc) |
|
|
1044 |
* @see IResource#getPersistentProperties() |
1045 |
*/ |
1046 |
public Map getPersistentProperties() throws CoreException { |
1047 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1048 |
return getPropertyManager().getProperties(this); |
1049 |
} |
1050 |
|
1051 |
/* (non-Javadoc) |
1043 |
* @see IResource#getProject() |
1052 |
* @see IResource#getProject() |
1044 |
*/ |
1053 |
*/ |
1045 |
public IProject getProject() { |
1054 |
public IProject getProject() { |
Lines 1097-1109
Link Here
|
1097 |
* @see IResource#getSessionProperty(QualifiedName) |
1106 |
* @see IResource#getSessionProperty(QualifiedName) |
1098 |
*/ |
1107 |
*/ |
1099 |
public Object getSessionProperty(QualifiedName key) throws CoreException { |
1108 |
public Object getSessionProperty(QualifiedName key) throws CoreException { |
1100 |
ResourceInfo info = getResourceInfo(false, false); |
1109 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1101 |
int flags = getFlags(info); |
|
|
1102 |
checkAccessible(flags); |
1103 |
checkLocal(flags, DEPTH_ZERO); |
1104 |
return info.getSessionProperty(key); |
1110 |
return info.getSessionProperty(key); |
1105 |
} |
1111 |
} |
1106 |
|
1112 |
|
|
|
1113 |
/* (non-Javadoc) |
1114 |
* @see IResource#getSessionProperties() |
1115 |
*/ |
1116 |
public Map getSessionProperties() throws CoreException { |
1117 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1118 |
return info.getSessionProperties(); |
1119 |
} |
1120 |
|
1107 |
public IFileStore getStore() { |
1121 |
public IFileStore getStore() { |
1108 |
return getLocalManager().getStore(this); |
1122 |
return getLocalManager().getStore(this); |
1109 |
} |
1123 |
} |
Lines 1497-1506
Link Here
|
1497 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1511 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1498 |
// fetch the info but don't bother making it mutable even though we are going |
1512 |
// fetch the info but don't bother making it mutable even though we are going |
1499 |
// to modify it. It really doesn't matter as the change we are doing does not show up in deltas. |
1513 |
// to modify it. It really doesn't matter as the change we are doing does not show up in deltas. |
1500 |
ResourceInfo info = getResourceInfo(false, false); |
1514 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1501 |
int flags = getFlags(info); |
|
|
1502 |
checkAccessible(flags); |
1503 |
checkLocal(flags, DEPTH_ZERO); |
1504 |
info.setModificationStamp(value); |
1515 |
info.setModificationStamp(value); |
1505 |
} |
1516 |
} |
1506 |
|
1517 |
|
Lines 1571-1580
Link Here
|
1571 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1582 |
throw new IllegalArgumentException("Illegal value: " + value); //$NON-NLS-1$ |
1572 |
// fetch the info but don't bother making it mutable even though we are going |
1583 |
// fetch the info but don't bother making it mutable even though we are going |
1573 |
// to modify it. It really doesn't matter as the change we are doing does not show up in deltas. |
1584 |
// to modify it. It really doesn't matter as the change we are doing does not show up in deltas. |
1574 |
ResourceInfo info = getResourceInfo(false, false); |
1585 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1575 |
int flags = getFlags(info); |
|
|
1576 |
checkAccessible(flags); |
1577 |
checkLocal(flags, DEPTH_ZERO); |
1578 |
return getLocalManager().setLocalTimeStamp(this, info, value); |
1586 |
return getLocalManager().setLocalTimeStamp(this, info, value); |
1579 |
} |
1587 |
} |
1580 |
|
1588 |
|
Lines 1582-1591
Link Here
|
1582 |
* @see IResource#setPersistentProperty(QualifiedName, String) |
1590 |
* @see IResource#setPersistentProperty(QualifiedName, String) |
1583 |
*/ |
1591 |
*/ |
1584 |
public void setPersistentProperty(QualifiedName key, String value) throws CoreException { |
1592 |
public void setPersistentProperty(QualifiedName key, String value) throws CoreException { |
1585 |
ResourceInfo info = getResourceInfo(false, false); |
1593 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1586 |
int flags = getFlags(info); |
|
|
1587 |
checkAccessible(flags); |
1588 |
checkLocal(flags, DEPTH_ZERO); |
1589 |
getPropertyManager().setProperty(this, key, value); |
1594 |
getPropertyManager().setProperty(this, key, value); |
1590 |
} |
1595 |
} |
1591 |
|
1596 |
|
Lines 1609-1618
Link Here
|
1609 |
* @see org.eclipse.core.resources.IResource#setResourceAttributes(org.eclipse.core.resources.ResourceAttributes) |
1614 |
* @see org.eclipse.core.resources.IResource#setResourceAttributes(org.eclipse.core.resources.ResourceAttributes) |
1610 |
*/ |
1615 |
*/ |
1611 |
public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { |
1616 |
public void setResourceAttributes(ResourceAttributes attributes) throws CoreException { |
1612 |
ResourceInfo info = getResourceInfo(false, false); |
1617 |
checkAccessibleAndLocal(DEPTH_ZERO); |
1613 |
int flags = getFlags(info); |
|
|
1614 |
checkAccessible(flags); |
1615 |
checkLocal(flags, DEPTH_ZERO); |
1616 |
getLocalManager().setResourceAttributes(this, attributes); |
1618 |
getLocalManager().setResourceAttributes(this, attributes); |
1617 |
} |
1619 |
} |
1618 |
|
1620 |
|
Lines 1623-1632
Link Here
|
1623 |
// fetch the info but don't bother making it mutable even though we are going |
1625 |
// fetch the info but don't bother making it mutable even though we are going |
1624 |
// to modify it. We don't know whether or not the tree is open and it really doesn't |
1626 |
// to modify it. We don't know whether or not the tree is open and it really doesn't |
1625 |
// matter as the change we are doing does not show up in deltas. |
1627 |
// matter as the change we are doing does not show up in deltas. |
1626 |
ResourceInfo info = getResourceInfo(false, false); |
1628 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1627 |
int flags = getFlags(info); |
|
|
1628 |
checkAccessible(flags); |
1629 |
checkLocal(flags, DEPTH_ZERO); |
1630 |
info.setSessionProperty(key, value); |
1629 |
info.setSessionProperty(key, value); |
1631 |
} |
1630 |
} |
1632 |
|
1631 |
|
Lines 1676-1685
Link Here
|
1676 |
final ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this); |
1675 |
final ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this); |
1677 |
try { |
1676 |
try { |
1678 |
workspace.prepareOperation(rule, monitor); |
1677 |
workspace.prepareOperation(rule, monitor); |
1679 |
ResourceInfo info = getResourceInfo(false, false); |
1678 |
ResourceInfo info = checkAccessibleAndLocal(DEPTH_ZERO); |
1680 |
int flags = getFlags(info); |
|
|
1681 |
checkAccessible(flags); |
1682 |
checkLocal(flags, DEPTH_ZERO); |
1683 |
|
1679 |
|
1684 |
workspace.beginOperation(true); |
1680 |
workspace.beginOperation(true); |
1685 |
// fake a change by incrementing the content ID |
1681 |
// fake a change by incrementing the content ID |