0

WebブラウザではなくスタンドアロンのAdobe Flash Playerでshockwaveファイルを再生する必要があり、そのshockwaveファイルにもコンテンツとしてxmlファイルが含まれています。すべての提案を歓迎します

4

2 に答える 2

0
import java.io.File;
import java.io.IOException;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

public class ReadHtml implements Runnable {
    private static String flashFileName = "";
    private static String flashXmlName = "";
    private static String flashString = "";
    private static String flashPlayer = "flashplayer_11_sa";
    private static String htmlFilePath = "";

    public final static void main(String[] args) throws Exception {
        File file = new File("D:/.../index.html");
        Document doc = null;
        Element link = null;
        if (file.exists()) {
            htmlFilePath = file.getParent();
            doc = Jsoup.parse(file, "UTF-8", "");
            link = doc.select("embed").first();
        }
        flashXmlName = link.attr("flashvars");
        flashFileName = link.attr("src");
        flashString = flashFileName + "?" + flashXmlName;
        flashString = htmlFilePath + File.separator + flashString;

        Thread CmdThread = new Thread(new ReadHtml());
        CmdThread.start();
    }
    @Override
    public void run() {
        try {
            final String[] cmdArray = { flashPlayer, flashString };
            final Process process = Runtime.getRuntime().exec(cmdArray);
            process.waitFor();
        } catch (IOException | InterruptedException e) {
            e.printStackTrace();
        }
    }
}
于 2013-11-13T10:55:30.537 に答える