本文整理了Java中java.net.HttpURLConnection.guessContentTypeFromStream()
方法的一些代码示例,展示了HttpURLConnection.guessContentTypeFromStream()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HttpURLConnection.guessContentTypeFromStream()
方法的具体详情如下:
包路径:java.net.HttpURLConnection
类名称:HttpURLConnection
方法名:guessContentTypeFromStream
暂无
代码示例来源:origin: wso2-attic/esb-connectors
public void addFileToRequest(String fieldName, File file) throws IOException {
InputStream inputStream = null;
try {
String contentType;
inputStream = new FileInputStream(file);
contentType = HttpURLConnection.guessContentTypeFromStream(inputStream);
inputStream.close();
addFileToRequest(fieldName, file, contentType);
} finally {
if (inputStream != null) {
inputStream.close();
}
}
}
代码示例来源:origin: org.wso2.esb.integration/integration-base
public void addFileToRequest(String fieldName, File file) throws IOException {
InputStream inputStream = null;
try {
String contentType;
inputStream = new FileInputStream(file);
contentType = HttpURLConnection.guessContentTypeFromStream(inputStream);
inputStream.close();
addFileToRequest(fieldName, file, contentType);
} finally {
if (inputStream != null) {
inputStream.close();
}
}
}
代码示例来源:origin: org.wso2.esb.integration/integration-base
public void addFileToRequest(String fieldName, String fileName) throws IOException {
File file = null;
InputStream inputStream = null;
try {
fileName = pathToResourcesDirectory + fileName;
file = new File(fileName);
String contentType;
inputStream = new FileInputStream(file);
contentType = HttpURLConnection.guessContentTypeFromStream(inputStream);
inputStream.close();
addFileToRequest(fieldName, file, contentType);
} finally {
if (inputStream != null) {
inputStream.close();
}
}
}
代码示例来源:origin: wso2-attic/esb-connectors
public void addFileToRequest(String fieldName, String fileName) throws IOException {
File file = null;
InputStream inputStream = null;
try {
fileName = pathToResourcesDirectory + fileName;
file = new File(fileName);
String contentType;
inputStream = new FileInputStream(file);
contentType = HttpURLConnection.guessContentTypeFromStream(inputStream);
inputStream.close();
addFileToRequest(fieldName, file, contentType);
} finally {
if (inputStream != null) {
inputStream.close();
}
}
}
代码示例来源:origin: org.n52.security/52n-security-gatekeeper
if (response_mime == null)
response_mime = HttpURLConnection
.guessContentTypeFromStream(ogcInputStream);
if (response_mime == null)
response_mime = "";
内容来源于网络,如有侵权,请联系作者删除!