1 package org.apache.archiva.repository.content;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.archiva.repository.ManagedRepositoryContent;
23 import org.apache.archiva.repository.UnsupportedConversionException;
24 import org.apache.archiva.repository.storage.StorageAsset;
28 public interface ContentItem
31 * Returns the repository type specific implementation
33 * @param clazz the specific implementation class
34 * @param <T> the class or interface
35 * @return the specific project implementation
37 <T extends Project> T adapt( Class<T> clazz ) throws UnsupportedConversionException;
40 * Returns <code>true</code>, if this project supports the given adaptor class.
42 * @param clazz the class to convert this project to
44 * @return <code>true/code>, if the implementation is supported, otherwise false
46 <T extends Project> boolean supports( Class<T> clazz );
49 * Additional attributes
51 * @return the additional attributes
53 Map<String, String> getAttributes( );
56 * Returns the attribute value for the given key.
58 * @param key the attribute key
59 * @return the value, if the key exists, otherwise <code>null</code>
61 String getAttribute( String key );
64 * Returns the storage representation of the artifact. The asset must not exist.
66 * @return the asset this artifact corresponds to.
68 StorageAsset getAsset( );
72 * The repository this project is part of.
74 * @return the repository content
76 ManagedRepositoryContent getRepository( );
79 * Returns <code>true</code>, if the item exists, otherwise <code>false</code>
80 * @return <code>true</code>, if the item exists, otherwise <code>false</code>