⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 share.java

📁 peeranha42是jxta的 p2p程序核心
💻 JAVA
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -