KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > cms > publication > PathToDocumentIdMapper


1 /*
2  * Copyright 1999-2004 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  */

17
18 /* $Id: PathToDocumentIdMapper.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.cms.publication;
21
22 import java.io.File JavaDoc;
23
24 /**
25  *
26  * This interface is basically the reverse of DocumentIdToPathMapper.
27  */

28 public interface PathToDocumentIdMapper {
29
30     /**
31      * Compute the document-id for a given file.
32      *
33      * @param publication the publication where the file is.
34      * @param area the area where the file is.
35      * @param file the file that is associated with the document
36      *
37      * @return the document-id of the document associated with the given file.
38      *
39      * @throws DocumentDoesNotExistException if there is no document associated with this file.
40      */

41     String JavaDoc getDocumentId(Publication publication, String JavaDoc area, File JavaDoc file)
42         throws DocumentDoesNotExistException;
43         
44     /**
45      * Returns the language for a given file
46      *
47      * @param file the document file
48      *
49      * @return the language for the given document file or null if the file
50      * has no language.
51      */

52     public String JavaDoc getLanguage(File JavaDoc file);
53
54 }
55
Popular Tags