View Javadoc

1   /*
2    * Copyright 2000-2005 The Apache Software Foundation.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.portals.graffito.jcr.version;
17  
18  import java.util.Calendar;
19  
20  import javax.jcr.RepositoryException;
21  
22  import org.apache.portals.graffito.jcr.exception.VersionException;
23  
24  /***
25   * 
26   * 
27   * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
28   * 
29   */
30  public class Version
31  {
32  
33  	private javax.jcr.version.Version version;
34  
35  	public Version(javax.jcr.version.Version version)
36  	{
37  		this.version = version;
38  	}
39  
40  	public Calendar getCreated()
41  	{
42  		try
43  		{
44  			return version.getCreated();
45  		}
46  		catch (RepositoryException e)
47  		{
48  
49  			throw new VersionException("Error while retrieving the version creation date", e);
50  		}
51  	}
52  
53  	public String getUuid()
54  	{
55  		try
56  		{
57  			return version.getUUID();
58  		}
59  		catch (RepositoryException e)
60  		{
61  
62  			throw new VersionException("Error while retrieving the version UUID", e);
63  		}
64  	}
65  
66  	public String getPath()
67  	{
68  		try
69  		{
70  			return version.getPath();
71  		}
72  		catch (RepositoryException e)
73  		{
74  
75  			throw new VersionException("Error while retrieving the version path", e);
76  		}
77  	}
78  
79  	public String getName()
80  	{
81  		try
82  		{
83  			return version.getName();
84  			
85  		}
86  		catch (RepositoryException e)
87  		{
88  
89  			throw new VersionException("Error while retrieving the version path", e);
90  		}
91  	}	
92  	
93  }