Enumeration<String> lockNullResourcesList =
currentLockNullResources.elements();
while (lockNullResourcesList.hasMoreElements()) {
- String lockNullPath = (String)
+ String lockNullPath =
lockNullResourcesList.nextElement();
if (lockNullPath.equals(path)) {
resp.setStatus(WebdavStatus.SC_MULTI_STATUS);
while ((!stack.isEmpty()) && (depth >= 0)) {
- String currentPath = (String) stack.pop();
+ String currentPath = stack.pop();
parseProperties(req, generatedXML, currentPath,
type, properties);
NamingEnumeration<NameClassPair> enumeration =
resources.list(currentPath);
while (enumeration.hasMoreElements()) {
- NameClassPair ncPair =
- (NameClassPair) enumeration.nextElement();
+ NameClassPair ncPair = enumeration.nextElement();
String newPath = currentPath;
if (!(newPath.endsWith("/")))
newPath += "/";
Enumeration<String> lockNullResourcesList =
currentLockNullResources.elements();
while (lockNullResourcesList.hasMoreElements()) {
- String lockNullPath = (String)
+ String lockNullPath =
lockNullResourcesList.nextElement();
parseLockNullProperties
(req, generatedXML, lockNullPath, type,
Vector<String> lockPaths = new Vector<String>();
locksList = collectionLocks.elements();
while (locksList.hasMoreElements()) {
- LockInfo currentLock = (LockInfo) locksList.nextElement();
+ LockInfo currentLock = locksList.nextElement();
if (currentLock.hasExpired()) {
resourceLocks.remove(currentLock.path);
continue;
}
locksList = resourceLocks.elements();
while (locksList.hasMoreElements()) {
- LockInfo currentLock = (LockInfo) locksList.nextElement();
+ LockInfo currentLock = locksList.nextElement();
if (currentLock.hasExpired()) {
resourceLocks.remove(currentLock.path);
continue;
generatedXML.writeElement(null, "href",
XMLWriter.OPENING);
generatedXML
- .writeText((String) lockPathsList.nextElement());
+ .writeText(lockPathsList.nextElement());
generatedXML.writeElement(null, "href",
XMLWriter.CLOSING);
generatedXML.writeElement(null, "status",
locksList = collectionLocks.elements();
while (locksList.hasMoreElements()) {
- LockInfo currentLock = (LockInfo) locksList.nextElement();
+ LockInfo currentLock = locksList.nextElement();
if (currentLock.path.equals(lock.path)) {
if (currentLock.isExclusive()) {
// Locking a single resource
// Retrieving an already existing lock on that resource
- LockInfo presentLock = (LockInfo) resourceLocks.get(lock.path);
+ LockInfo presentLock = resourceLocks.get(lock.path);
if (presentLock != null) {
if ((presentLock.isExclusive()) || (lock.isExclusive())) {
// Checking resource locks
- LockInfo toRenew = (LockInfo) resourceLocks.get(path);
+ LockInfo toRenew = resourceLocks.get(path);
Enumeration<String> tokenList = null;
if (lock != null) {
tokenList = toRenew.tokens.elements();
while (tokenList.hasMoreElements()) {
- String token = (String) tokenList.nextElement();
+ String token = tokenList.nextElement();
if (ifHeader.indexOf(token) != -1) {
toRenew.expiresAt = lock.expiresAt;
lock = toRenew;
Enumeration<LockInfo> collectionLocksList =
collectionLocks.elements();
while (collectionLocksList.hasMoreElements()) {
- toRenew = (LockInfo) collectionLocksList.nextElement();
+ toRenew = collectionLocksList.nextElement();
if (path.equals(toRenew.path)) {
tokenList = toRenew.tokens.elements();
while (tokenList.hasMoreElements()) {
- String token = (String) tokenList.nextElement();
+ String token = tokenList.nextElement();
if (ifHeader.indexOf(token) != -1) {
toRenew.expiresAt = lock.expiresAt;
lock = toRenew;
// Checking resource locks
- LockInfo lock = (LockInfo) resourceLocks.get(path);
+ LockInfo lock = resourceLocks.get(path);
Enumeration<String> tokenList = null;
if (lock != null) {
tokenList = lock.tokens.elements();
while (tokenList.hasMoreElements()) {
- String token = (String) tokenList.nextElement();
+ String token = tokenList.nextElement();
if (lockTokenHeader.indexOf(token) != -1) {
lock.tokens.removeElement(token);
}
Enumeration<LockInfo> collectionLocksList = collectionLocks.elements();
while (collectionLocksList.hasMoreElements()) {
- lock = (LockInfo) collectionLocksList.nextElement();
+ lock = collectionLocksList.nextElement();
if (path.equals(lock.path)) {
tokenList = lock.tokens.elements();
while (tokenList.hasMoreElements()) {
- String token = (String) tokenList.nextElement();
+ String token = tokenList.nextElement();
if (lockTokenHeader.indexOf(token) != -1) {
lock.tokens.removeElement(token);
break;
// Create a place for the normalized path
String normalized = path;
- if (normalized == null)
- return (null);
-
if (normalized.equals("/."))
return "/";
// Checking resource locks
- LockInfo lock = (LockInfo) resourceLocks.get(path);
+ LockInfo lock = resourceLocks.get(path);
Enumeration<String> tokenList = null;
if ((lock != null) && (lock.hasExpired())) {
resourceLocks.remove(path);
tokenList = lock.tokens.elements();
boolean tokenMatch = false;
while (tokenList.hasMoreElements()) {
- String token = (String) tokenList.nextElement();
+ String token = tokenList.nextElement();
if (ifHeader.indexOf(token) != -1)
tokenMatch = true;
}
Enumeration<LockInfo> collectionLocksList = collectionLocks.elements();
while (collectionLocksList.hasMoreElements()) {
- lock = (LockInfo) collectionLocksList.nextElement();
+ lock = collectionLocksList.nextElement();
if (lock.hasExpired()) {
collectionLocks.removeElement(lock);
} else if (path.startsWith(lock.path)) {
tokenList = lock.tokens.elements();
boolean tokenMatch = false;
while (tokenList.hasMoreElements()) {
- String token = (String) tokenList.nextElement();
+ String token = tokenList.nextElement();
if (ifHeader.indexOf(token) != -1)
tokenMatch = true;
}
try {
object = resources.lookup(source);
} catch (NamingException e) {
+ // Ignore
}
if (object instanceof DirContext) {
NamingEnumeration<NameClassPair> enumeration =
resources.list(source);
while (enumeration.hasMoreElements()) {
- NameClassPair ncPair = (NameClassPair) enumeration.nextElement();
+ NameClassPair ncPair = enumeration.nextElement();
String childDest = dest;
if (!childDest.equals("/"))
childDest += "/";
}
while (enumeration.hasMoreElements()) {
- NameClassPair ncPair = (NameClassPair) enumeration.nextElement();
+ NameClassPair ncPair = enumeration.nextElement();
String childName = path;
if (!childName.equals("/"))
childName += "/";
Enumeration<String> pathList = errorList.keys();
while (pathList.hasMoreElements()) {
- String errorPath = (String) pathList.nextElement();
- int errorCode = ((Integer) errorList.get(errorPath)).intValue();
+ String errorPath = pathList.nextElement();
+ int errorCode = errorList.get(errorPath).intValue();
generatedXML.writeElement(null, "response", XMLWriter.OPENING);
while (properties.hasMoreElements()) {
- String property = (String) properties.nextElement();
+ String property = properties.nextElement();
if (property.equals("creationdate")) {
generatedXML.writeProperty
while (propertiesNotFoundList.hasMoreElements()) {
generatedXML.writeElement
- (null, (String) propertiesNotFoundList.nextElement(),
+ (null, propertiesNotFoundList.nextElement(),
XMLWriter.NO_CONTENT);
}
return;
// Retrieving the lock associated with the lock-null resource
- LockInfo lock = (LockInfo) resourceLocks.get(path);
+ LockInfo lock = resourceLocks.get(path);
if (lock == null)
return;
while (properties.hasMoreElements()) {
- String property = (String) properties.nextElement();
+ String property = properties.nextElement();
if (property.equals("creationdate")) {
generatedXML.writeProperty
while (propertiesNotFoundList.hasMoreElements()) {
generatedXML.writeElement
- (null, (String) propertiesNotFoundList.nextElement(),
+ (null, propertiesNotFoundList.nextElement(),
XMLWriter.NO_CONTENT);
}
private boolean generateLockDiscovery
(String path, XMLWriter generatedXML) {
- LockInfo resourceLock = (LockInfo) resourceLocks.get(path);
+ LockInfo resourceLock = resourceLocks.get(path);
Enumeration<LockInfo> collectionLocksList = collectionLocks.elements();
boolean wroteStart = false;
}
while (collectionLocksList.hasMoreElements()) {
- LockInfo currentLock =
- (LockInfo) collectionLocksList.nextElement();
+ LockInfo currentLock = collectionLocksList.nextElement();
if (path.startsWith(currentLock.path)) {
if (!wroteStart) {
wroteStart = true;
* Constructor.
*/
public LockInfo() {
-
+ // Ignore
}
new StringReader("Ignored external entity"));
}
}
-};
+}
// -------------------------------------------------------- WebdavStatus Class
if (!mapStatusCodes.containsKey(intKey)) {
return "";
} else {
- return (String) mapStatusCodes.get(intKey);
+ return mapStatusCodes.get(intKey);
}
}
mapStatusCodes.put(new Integer(nKey), strVal);
}
-};
+}