share.java
来自「peeranha42是jxta的 p2p程序核心」· Java 代码 · 共 53 行
JAVA
53 行
package de.uni_bremen.informatik.p2p.plugins.filesharing.data;
import java.io.File;
import de.uni_bremen.informatik.p2p.plugins.filesharing.control.FileUtilities;
/**
* An object of the class Share represents a share auf the filesharing plugin.
* A share can be a file or a directory.
*
* @author Lars Kordes, Philipp Hoheisel
*/
public class Share {
/** File itself */
public File file;
/** Hash value of the file data. */
public String hash;
/**
* Classconstructor.
*
* @param path Path of the file.
* @param filename Name of the file.
*/
public Share(String path,
String filename) {
this.file = new File(path, filename);
hash = FileUtilities.generateHashString(this.file.getPath());
}
/**
* Creates a new Share object.
*
* @param path Path of object
*/
public Share(String path) {
this.file = new File(path);
hash = FileUtilities.generateHashString(this.file.getPath());
}
/**
* Creates a new Share object.
*
* @param file File to share
*/
public Share(File file) {
this.file = file;
hash = FileUtilities.generateHashString(this.file.getPath());
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?