private FileDescriptor generateSharedFileDescriptor() { FileDescriptor descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9}; descriptor.filename = "meals.txt"; descriptor.owner = "bar"; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/shared"; descriptor.size = 100; return descriptor; }
private FileDescriptor generateSingleDescriptor() { FileDescriptor descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}; descriptor.filename = "test.txt"; descriptor.owner = "Adam"; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/testFile"; descriptor.size = 100000; return descriptor; }
private FileDescriptor[] generateKnownAnnouncedDummyDescriptorArray(String owner) { ArrayList<FileDescriptor> fileList = new ArrayList<FileDescriptor>(); FileDescriptor descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; descriptor.filename = "house.png"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/photos"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}; descriptor.filename = "backyard.png"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/photos"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}; descriptor.filename = "fireplace.png"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/photos"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}; descriptor.filename = "animals.txt"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/reports"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}; descriptor.filename = "inventors.txt"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/reports"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6}; descriptor.filename = "driving.txt"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/reports"; descriptor.size = 100; fileList.add(descriptor); return fileList.toArray(new FileDescriptor[fileList.size()]); }
private FileDescriptor[] generateKnownSharedDummyDescriptorArray(String owner) { ArrayList<FileDescriptor> fileList = new ArrayList<FileDescriptor>(); FileDescriptor descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10}; descriptor.filename = "house.png"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/photos"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}; descriptor.filename = "backyard.png"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/photos"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12}; descriptor.filename = "fireplace.png"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/photos"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13}; descriptor.filename = "animals.txt"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/reports"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14}; descriptor.filename = "inventors.txt"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/reports"; descriptor.size = 100; fileList.add(descriptor); descriptor = new FileDescriptor(); descriptor.fileID = new byte[] {15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15}; descriptor.filename = "driving.txt"; descriptor.owner = owner; descriptor.relativePath = ""; descriptor.sharedPath = "sdcard/reports"; descriptor.size = 100; fileList.add(descriptor); return fileList.toArray(new FileDescriptor[fileList.size()]); }