资源简介
tomcat-connectors-1.2.37-src.tar
代码片段和文件信息
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License Version 2.0
* (the “License“); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing software
* distributed under the License is distributed on an “AS IS“ BASIS
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.jk.status;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
import org.apache.catalina.ant.AbstractCatalinaTask;
import org.apache.catalina.util.base64;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
/**
* Ant task that implements mod_jk 1.2.20 result message string
*
* @author Peter Rossbach
* @version $Revision: 802231 $
* @since mod_jk 1.2.20
*/
public abstract class AbstractJkStatusTask extends AbstractCatalinaTask {
/**
* Execute the requested operation.
*
* @exception BuildException
* if an error occurs
*/
public void execute() throws BuildException {
super.execute();
checkParameter();
StringBuffer sb = createlink();
execute(sb.toString() null null -1);
}
protected abstract void checkParameter() ;
protected abstract StringBuffer createlink() ;
/**
* Execute the specified command based on the configured properties.
* The input stream will be closed upon completion of this task whether
* it was executed successfully or not.
*
* @param command Command to be executed
* @param istream InputStream to include in an HTTP PUT if any
* @param contentType Content type to specify for the input if any
* @param contentLength Content length to specify for the input if any
*
* @exception BuildException if an error occurs
*/
public void execute(String command InputStream istream
String contentType int contentLength)
throws BuildException {
InputStreamReader reader = null;
try {
HttpURLConnection hconn = send(command istream contentType contentLength);
// Process the response message
reader = new InputStreamReader(hconn.getInputStream() “UTF-8“);
String error = null;
error = handleRe
- 上一篇:抖音高保真原型
- 下一篇:边缘计算参考架构3.0(2018年)
评论
共有 条评论