NetStorageSender extends HttpSenderBase { @Override public void configure() throws ConfigurationException { Parameter urlParameter = new Parameter(); urlParameter.setName(getUrlParam()); urlParameter.setSessionKey(URL_PARAM_KEY); addParameter(urlParameter); super.configure(); if(getAction() == null) throw new ConfigurationException(getLogPrefix()+"action must be specified"); if(!actions.contains(getAction())) throw new ConfigurationException(getLogPrefix()+"unknown or invalid action ["+getAction()+"] supported actions are "+actions.toString()+""); if(getCpCode() == null) throw new ConfigurationException(getLogPrefix()+"cpCode must be specified"); if(!getUrl().startsWith("http")) throw new ConfigurationException(getLogPrefix()+"url must be start with http(s)"); if(hashAlgorithm != null && !hashAlgorithms.contains(hashAlgorithm)) throw new ConfigurationException(getLogPrefix()+"unknown authenticationMethod ["+hashAlgorithm+"] supported methods are "+hashAlgorithms.toString()+""); if(getSignVersion() < 3 || getSignVersion() > 5) throw new ConfigurationException(getLogPrefix()+"signVersion must be either 3, 4 or 5"); ParameterList parameterList = getParameterList(); if(getAction().equals("upload") && parameterList.findParameter("file") == null) throw new ConfigurationException(getLogPrefix()+"the upload action requires a file parameter to be present"); if(getAction().equals("rename") && parameterList.findParameter("destination") == null) throw new ConfigurationException(getLogPrefix()+"the rename action requires a destination parameter to be present"); if(getAction().equals("mtime") && parameterList.findParameter("mtime") == null) throw new ConfigurationException(getLogPrefix()+"the mtime action requires a mtime parameter to be present"); accessTokenCf = new CredentialFactory(getAuthAlias(), getNonce(), getAccessToken()); }  @Override void configure(); @Override Message sendMessage(Message message, IPipeLineSession session); @Override HttpRequestBase getMethod(URI uri, Message message, ParameterValueList parameters, IPipeLineSession session); @Override Message extractResult(HttpResponseHandler responseHandler, IPipeLineSession session); String getResponseBodyAsString(HttpResponseHandler responseHandler); @IbisDoc({"only works in combination with the <code>upload</code> action. if set, and not specified as parameter, the sender will sign the file to be uploaded. possible values: md5, sha1, sha256. <br/>note: if the file input is a stream this will put the file in memory!", ""}) void setHashAlgorithm(String hashAlgorithm); @IbisDoc({"possible values: delete, dir, download, du, mkdir, mtime, rename, rmdir, upload", ""}) void setAction(String action); String getAction(); @IbisDoc({"akamai currently only supports action version 1!", "1"}) void setActionVersion(int actionVersion); @IbisDoc({"the cp code to be used", ""}) void setCpCode(String cpCode); String getCpCode(); @IbisDoc({"the destination, aka akamai host. only the hostname is allowed; eq. xyz-nsu.akamaihd.net", ""}) @Override void setUrl(String url); @Override String getUrl(); @IbisDoc({"the nonce or api username", ""}) void setNonce(String nonce); String getNonce(); @IbisDoc({"the version used to sign the authentication headers. possible values: 3 (md5), 4 (sha1), 5 (sha256)", "5"}) void setSignVersion(int signVersion); int getSignVersion(); SignType getSignType(); @IbisDoc({"the api accesstoken", ""}) void setAccessToken(String accessToken); String getAccessToken(); @Override String getPhysicalDestinationName(); String getRootDir(); @IbisDoc({"<i>optional</i> root directory", ""}) void setRootDir(String rootDir); @Override String getAuthAlias(); @IbisDoc({"alias used to obtain credentials for nonce (username) and accesstoken (password)", ""}) @Override void setAuthAlias(String authAlias);  }
@Test public void testContentType() throws Throwable { NetStorageSender sender = getSender(); sender.configure(); assertNull("no content-type should be present", sender.getFullContentType()); }