blob: 8b86efe7e5b344f65cd7d989cb9df5e36b05e33f [file] [log] [blame]
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/* $Id$ */
package org.apache.lenya.cms.rc;
import java.util.Date;
/**
* Exception for already checked out files
*/
public class FileReservedCheckOutException extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
private String source = null;
private Date checkOutDate = null;
private String checkOutUsername = null;
/**
* Creates a new FileReservedCheckOutException object.
* @param _source The source
* @param rcml The RCML
* @throws Exception if an error occurs
*/
public FileReservedCheckOutException(String _source, RCML rcml)
throws Exception {
this.source = _source;
try {
CheckOutEntry coe = rcml.getLatestCheckOutEntry();
this.checkOutUsername = coe.getIdentity();
this.checkOutDate = new Date(coe.getTime());
} catch (Exception e) {
throw new Exception("Unable to create FileReservedCheckOutException object!");
}
}
/**
* Get the date of the checkout.
* @return the date of the checkout
*/
public Date getCheckOutDate() {
return new Date(this.checkOutDate.getTime());
}
/**
* Get the source of the checkout.
* @return the source of the checkout
*/
public String getSource() {
return this.source;
}
/**
* Get the user name who did this checkout.
* @return the user name of this checkout
*/
public String getCheckOutUsername() {
return this.checkOutUsername;
}
}