Revision afaf8a42

b/src/gr/ebs/gss/server/webdav/milton/GssRootFolderResource.java
32 32
import org.slf4j.LoggerFactory;
33 33

  
34 34
import com.bradmcevoy.http.Auth;
35
import com.bradmcevoy.http.LockInfo;
36
import com.bradmcevoy.http.LockResult;
37
import com.bradmcevoy.http.LockTimeout;
38
import com.bradmcevoy.http.LockToken;
35 39
import com.bradmcevoy.http.Request;
36 40
import com.bradmcevoy.http.Resource;
37 41
import com.bradmcevoy.http.Request.Method;
42
import com.bradmcevoy.http.exceptions.NotAuthorizedException;
38 43
import com.bradmcevoy.http.http11.auth.DigestResponse;
39 44

  
40 45

  
......
104 109
	}
105 110
	@Override
106 111
	public Resource child(String name) {
107
		//log.info("CALLING ROOT GET CHILDREN");
112
		log.info("CALLING ROOT GET CHILD:"+getCurrentUser());
108 113
		if(this.folder==null)
109 114
			try {
110 115
				this.folder = (FolderDTO) factory.getResourceGss(path,getCurrentUser());
......
116 121
	}
117 122
	@Override
118 123
	public List<? extends Resource> getChildren() {
119
		//log.info("CALLING ROOT GET CHILDREN");
124
		//log.info("CALLING ROOT GET CHILDREN:"+getCurrentUser());
120 125
		if(this.folder==null)
121 126
			try {
122 127
				this.folder = (FolderDTO) factory.getResourceGss(path,getCurrentUser());
......
144 149
		//result.add(new GssOthersResource(host, factory));
145 150
		return result;
146 151
	}
152
	
153
	/*Disable Locks if folder is null*/
154
	public LockResult lock(LockTimeout timeout, LockInfo lockInfo) throws NotAuthorizedException {
155
		if(folder==null)
156
			throw new NotAuthorizedException(this);
157
        return factory.getLockManager().lock(timeout, lockInfo, this);
158
    }
159

  
160
    public LockResult refreshLock(String token) throws NotAuthorizedException {
161
    	if(folder==null)
162
			throw new NotAuthorizedException(this);
163
        return factory.getLockManager().refresh(token, this);
164
    }
165

  
166
    public void unlock(String tokenId) throws NotAuthorizedException {
167
    	if(folder==null)
168
			throw new NotAuthorizedException(this);
169
        factory.getLockManager().unlock(tokenId, this);
170
    }
171

  
172
    public LockToken getCurrentLock() {
173
    	if(folder==null)
174
			return null;
175
        if( factory.getLockManager() != null ) {
176
            return factory.getLockManager().getCurrentToken( this );
177
        } else {
178
            log.warn("getCurrentLock called, but no lock manager: file: " + resource);
179
            return null;
180
        }
181
    }
147 182

  
148 183
}

Also available in: Unified diff