001/* 002 * The contents of this file are subject to the license and copyright 003 * detailed in the LICENSE and NOTICE files at the root of the source 004 * tree. 005 */ 006package org.fcrepo.kernel.api.models; 007 008import java.io.InputStream; 009import java.net.URI; 010 011/** 012 * Interface for the ExternalContent information class. 013 * @author bseeger 014 */ 015public interface ExternalContent { 016 017 String PROXY = "proxy"; 018 String REDIRECT = "redirect"; 019 String COPY = "copy"; 020 021 /** 022 * Returns the content type located in the link header. 023 * @return content type if in Link header, else null 024 */ 025 public String getContentType(); 026 027 /** 028 * Returns the size of the content located at the link header 029 * @return content size 030 */ 031 public long getContentSize(); 032 033 /** 034 * Retrieve handling information 035 * @return a String containing the type of handling requested ["proxy", "copy" or "redirect"] 036 */ 037 public String getHandling(); 038 039 /** 040 * Retrieve url in link header 041 * @return a String of the URL that was in the Link header 042 */ 043 public String getURL(); 044 045 /** 046 * Retrieve URI in link header 047 * @return a URI to the external content 048 */ 049 public URI getURI(); 050 051 /** 052 * Returns whether or not the handling parameter is "copy" 053 * @return boolean value representing whether or not the content handling is "copy" 054 */ 055 public boolean isCopy(); 056 057 /** 058 * Returns whether or not the handling parameter is "redirect" 059 * @return boolean value representing whether or not the content handling is "redirect" 060 */ 061 public boolean isRedirect(); 062 063 /** 064 * Returns whether or not the handling parameter is "proxy" 065 * @return boolean value representing whether or not the content handling is "proxy" 066 */ 067 public boolean isProxy(); 068 069 /** 070 * Fetch the external content 071 * @return InputStream containing the external content 072 */ 073 public InputStream fetchExternalContent(); 074}