のBluetooth FTPの仕様は、私がACTION操作を使用する必要があると言い、こちらのページでは http://i47.tinypic.com/2425t2v.pngJ2ME Bluetooth OBEXでACTION(move/rename、set permissions)操作を実装する方法は?
だがClentSessionは、GETやPUT操作を提供し、何もjavadocをに言及していません。ここ
は、作成ファイル操作が、見えます、それは非常に簡単です方法です
public void create() throws IOException {
HeaderSet hs = cs.createHeaderSet();
hs.setHeader(HeaderSet.NAME, file);
op = cs.put(hs);
OutputStream os = op.openOutputStream();
os.close();
op.close();
}
質問1:どのように私は移動/名前の変更、設定の権限を実行するためにカスタムヘッダーとACTION操作を実装していますか? JSR82 OBEX APIがなければ可能です。これを手伝ってください。
質問2: 権限を設定する方法を理解しましたか? 読み取り専用に設定し、そうOBEX_Errata 1.3.pdf用にコンパイルされた(感謝alanjmcf!)
1 http://i45.tinypic.com/2h84led.jpg
2 http://i49.tinypic.com/2wgysmx.png
によると、私は次のことを行う必要があります。
int a = 0;
//byte 0 //zero
//byte 1 //user
//byte 2 //group
//byte 3 //other
//set read for user
a |= (1 << 7); //8th bit - byte 1, bit 0 -> set to 1
// a = 10000000
//for group
a |= (1 << 15); //16th bit - byte 2, bit 0 -> set to 1
// a = 1000000010000000
//for other
a |= (1 << 23); //24th bit - byte 3, bit 0 -> set to 1
// a = 100000001000000010000000
//or simply
private static final int READ = 8421504 //1000,0000,1000,0000,1000,0000
int value = 0 | READ;
//========== calculate write constant =========
a = 0;
a |= (1 << 8); //write user
a |= (1 << 16); //write group
a |= (1 << 24); //write other
// a = 1000000010000000100000000
private static final int WRITE = 16843008 // 1,0000,0001,0000,0001,0000,0000
//========= calculate delete constant ==========
a = 0;
a |= (1 << 9); //delete user
a |= (1 << 17); //delete group
a |= (1 << 25); //delete other
//a = 10000000100000001000000000
private static final DELETE = 33686016; //10,0000,0010,0000,0010,0000,0000
//========= calculate modify constant ==========
a = 0;
a |= (1 << (7 + 7)); //modify user
a |= (1 << (15 + 7)); //modify group
a |= (1 << (23 + 7)); //modify other
//a = 1000000010000000100000000000000
private static final MODIFY = 1077952512; // 100,0000,0100,0000,0100,0000,0000,0000
// now, if i want to set read-write-delete-modify, I will do the following:
int rwdm = 0 | READ | WRITE | DELETE | MODIFY;
// and put the value to the header... am I right?
場合唯一の問題は質問1です。私はACTION操作をどのようにして、どのようにヘッダを設定するのですか?
+1すべての光沢のある写真に+1! –
http://code.google.com/p/blueframe/source/checkout-多分そこに何か –
@AmigableClarkKantデバイスは、独自のフォーマットのデータを交換します。ターゲットデバイスがOBEXデバイスとして認識するヘッダーを作成するのに役立ちません。 –