📄 feeddatasource.java
字号:
package com.jeffhanson.atompub.service;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.activation.DataSource;
public class FeedDataSource
implements DataSource
{
private File file = null;
private String contentType = "";
public FeedDataSource(File file, String contentType)
{
this.file = file;
this.contentType = contentType;
}
public String getContentType()
{
return contentType;
}
public InputStream getInputStream()
throws IOException
{
return new FileInputStream(file);
}
public String getName()
{
return file.getName();
}
public OutputStream getOutputStream()
throws IOException
{
return new FileOutputStream(file);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -