1 /** 2 * This file Copyright (c) 2013-2015 Magnolia International 3 * Ltd. (http://www.magnolia-cms.com). All rights reserved. 4 * 5 * 6 * This file is dual-licensed under both the Magnolia 7 * Network Agreement and the GNU General Public License. 8 * You may elect to use one or the other of these licenses. 9 * 10 * This file is distributed in the hope that it will be 11 * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the 12 * implied warranty of MERCHANTABILITY or FITNESS FOR A 13 * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT. 14 * Redistribution, except as permitted by whichever of the GPL 15 * or MNA you select, is prohibited. 16 * 17 * 1. For the GPL license (GPL), you can redistribute and/or 18 * modify this file under the terms of the GNU General 19 * Public License, Version 3, as published by the Free Software 20 * Foundation. You should have received a copy of the GNU 21 * General Public License, Version 3 along with this program; 22 * if not, write to the Free Software Foundation, Inc., 51 23 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 24 * 25 * 2. For the Magnolia Network Agreement (MNA), this file 26 * and the accompanying materials are made available under the 27 * terms of the MNA which accompanies this distribution, and 28 * is available at http://www.magnolia-cms.com/mna.html 29 * 30 * Any modifications to this file must keep this entire header 31 * intact. 32 * 33 */ 34 package info.magnolia.dam.asset; 35 36 import info.magnolia.dam.DamException; 37 import info.magnolia.dam.asset.metadata.AssetMetadata; 38 import info.magnolia.dam.asset.metadata.AssetMetadataTypeNotSupportedException; 39 //import info.magnolia.dam.asset.metadata.AssetMetadata; 40 //import info.magnolia.dam.asset.metadata.AssetMetadataTypeNotSupportedException; 41 42 import java.io.InputStream; 43 import java.util.Calendar; 44 45 /** 46 * Asset interface definition. Important: getIdentifier() must return the composite Id. 47 * @deprecated since 2.0 use {@link info.magnolia.dam.api.Asset} - included here for backwards compatibility. 48 */ 49 @Deprecated 50 public interface Asset { 51 52 53 /** 54 * @return Name of the Asset. 55 */ 56 public String getName(); 57 58 /** 59 * @return String representation of Locale {@linkplain http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt}. 60 */ 61 public String getLanguage(); 62 63 /** 64 * <b>This identifier is the key used by the 65 * {@link info.magnolia.dam.DamIdParser} in order to be able to identify 66 * both:<br> 67 * the Asset <br> 68 * the Asset Provider. </b> 69 * 70 * @return Unique Identifier of the Asset. 71 */ 72 public String getIdentifier(); 73 74 /** 75 * @return Title of the Asset. 76 */ 77 public String getTitle(); 78 79 /** 80 * @return The MediaType definition part of the {@link MediaType}. 81 */ 82 public String getMediaType(); 83 84 /** 85 * @return The Subject of the Asset. 86 */ 87 public String getSubject(); 88 89 /** 90 * @return The Description of Asset. 91 */ 92 public String getDescription(); 93 94 /** 95 * @return The Asset Caption. 96 */ 97 public String getCaption(); 98 99 /** 100 * @return The Asset Copyright. 101 */ 102 public String getCopyright(); 103 104 /** 105 * @return The Asset binary content mimeType. 106 */ 107 public String getMimeType(); 108 109 /** 110 * @return The Asset binary content size. 111 */ 112 public long getFileSize(); 113 114 /** 115 * @return The Asset binary data as {@link InputStream}. 116 */ 117 public InputStream getContentStream(); 118 119 /** 120 * @return The specific implementation of the requested Metadata. Null if the specified implementation was not found. 121 */ 122 public AssetMetadata getMetadata(String metaDataType) throws AssetMetadataTypeNotSupportedException; 123 124 /** 125 * @return Return the Link to the default rendition. 126 * @throws DamException 127 */ 128 public String getLink() throws DamException; 129 130 /** 131 * @return The Asset path. For JCR this is equivalent to Node.getPath() 132 */ 133 public String getPath(); 134 135 /** 136 * @return The Asset last modified Date. 137 */ 138 public Calendar getLastModified(); 139 140 /** 141 * @return The Asset Binary content extension. 142 */ 143 public String getFileExtension(); 144 145 /** 146 * @return The Asset Binary content file Name. 147 */ 148 public String getFileName(); 149 150 /** 151 * @return The Asset comment. 152 */ 153 public String getComment(); 154 155 /** 156 * @return The related Asset Provider Id. 157 */ 158 public String getAssetProviderIdentifier(); 159 160 /** 161 * Give the ability to access a custom property from the Asset API. 162 * 163 * @param propertyName 164 * @return The Asset property referred to by the propertyName. Null if not 165 * found. 166 */ 167 public Object getCustomProperty(String propertyName); 168 169 }