문제

사용하려고합니다 JSR 75 장치의 '/home/video/'디렉토리에 저장된 미디어에 액세스하려면 Blackbery JDK 사용 4.6.1. 한 줄의 코드 라인은 'FileSystem IO Error' 예외. 평소와 같이 극단적으로 도움이되지 않습니다.

fconn = (FileConnection)Connector.open("file:///home/user/videos/"+name, Connector.READ);

누구 든지이 작업을 시도한 적이 있습니까? 항아리 내에서 파일을 열 수 있지만 미디어 폴더에 액세스 할 수없는 것 같습니다. 나는 이것 가지다 javax.microedition.io.Connector.file.read 권한 세트 및 내 적절성이 서명되었습니다.

도움이 되었습니까?

해결책

BlackBerry에는 SDCard와 Store에는 두 가지 종류의 파일 시스템이 있습니다. 당신은 그들 중 하나를 사용하여 경로에서 정의해야합니다. 비디오, 음악 등이 저장된 SDCard의 표준 디렉토리는 "파일 : /// SDCard/BlackBerry"입니다.

    String standardPath = "file:///SDCard/BlackBerry";
    String videoDir = System.getProperty("fileconn.dir.videos.name");
    String fileName = "video.txt";
    String path = standardPath+"/"+videoDir+"/"+fileName;
    String content = "";
    FileConnection fconn =  null;
    DataInputStream is = null;
    ByteVector bytes = new ByteVector();
    try {
        fconn = (FileConnection) Connector.open(path, Connector.READ);
        is = fconn.openDataInputStream();

        int c = is.read();
        while(-1 != c)
        {
            bytes.addElement((byte) (c));
            c = is.read();
        }

    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    content = new String(bytes.toArray());
    add(new RichTextField(content));

또한보십시오
Sun Dev Network- FileConnection API를 시작하기
림 포럼 - FileConnection/JSR 75에 대한 몇 가지 질문
system.getProperty ( "fileconn.dir.MemoryCard")를 사용하여 sdcard를 사용할 수 있는지 확인하십시오.
BlackBerry Storm에서 비트 맵 이미지를 저장 및 삭제하는 방법은 무엇입니까?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top