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

📄 filemanager.java

📁 GPS Track connects to a GPS and records the path that you travel. Tracks can be uploaded to a web s
💻 JAVA
字号:
// J2ME GPS Track
// Copyright (C) 2007 Dana Peters
// http://www.qcontinuum.org/gpstrack

package org.qcontinuum.gpstrack;

import java.util.*;
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.io.file.*;

// optional package wrapper class
// technique described in Chapter 8 of JSR 248

public class FileManager implements FileUsage {
    
    FileConnection mFileConnection;

    public FileManager() {
   
    }

    public Enumeration listRoots() {
        return FileSystemRegistry.listRoots();
    }

    public Enumeration getFiles(String path) throws IOException {
        FileConnection fileConnection = null;
        try {
            fileConnection = (FileConnection)Connector.open(path, Connector.READ);
            return fileConnection.list();
        } finally {
            if (fileConnection != null)
                fileConnection.close();
        }
    }

    public DataOutputStream open(String filename) throws IOException {
        mFileConnection = (FileConnection)Connector.open(filename);
        if (!mFileConnection.exists())
            mFileConnection.create();
        mFileConnection.setWritable(true);
        return mFileConnection.openDataOutputStream();
    }
    
    public void close() throws IOException {
        if (mFileConnection != null)
            mFileConnection.close();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -