Home
last modified time | relevance | path

Searched refs:openContext (Results 1 – 24 of 24) sorted by relevance

/external/mobile-data-download/java/com/google/android/libraries/mobiledatadownload/file/openers/
DStreamMutationOpener.java87 public Mutator open(OpenContext openContext) throws IOException { in open() argument
88 return new Mutator(openContext, locking, behaviors); in open()
94 private final OpenContext openContext; field in StreamMutationOpener.Mutator
99 OpenContext openContext, @Nullable LockFileOpener locking, @Nullable Behavior[] behaviors) in Mutator() argument
101 this.openContext = openContext; in Mutator()
104 lock = locking.open(openContext); in Mutator()
114 try (InputStream backendIn = openForReadOrEmpty(openContext.encodedUri()); in mutate()
115 InputStream in = openContext.chainTransformsForRead(backendIn).get(0)) { in mutate()
116 Uri tempUri = ScratchFile.scratchUri(openContext.originalUri()); in mutate()
118 try (OutputStream backendOut = openContext.backend().openForWrite(tempUri)) { in mutate()
[all …]
DLockFileOpener.java98 public Closeable open(OpenContext openContext) throws IOException { in open() argument
101 openContext in open()
104 .path(openContext.encodedUri().getPath() + LOCK_SUFFIX) in open()
109 ReleasableResource.create(openThreadLock(openContext, lockUri))) { in open()
115 ReleasableResource.create(openStreamForLocking(openContext, lockUri)); in open()
117 ReleasableResource.create(openFileLock(openContext, streamResource.get()))) { in open()
141 private Closeable openThreadLock(OpenContext openContext, Uri lockUri) throws IOException { in openThreadLock() argument
143 return openContext.backend().lockScope().tryThreadLock(lockUri); in openThreadLock()
145 return openContext.backend().lockScope().threadLock(lockUri); in openThreadLock()
150 private Closeable openStreamForLocking(OpenContext openContext, Uri lockUri) throws IOException { in openStreamForLocking() argument
[all …]
DSystemLibraryOpener.java68 public Void open(OpenContext openContext) throws IOException { in open() argument
72 file = ReadFileOpener.create().open(openContext); in open()
81 .appendPath(hashedLibraryName(openContext.originalUri())) in open()
84 file = openContext.storage().open(cachedUri, ReadFileOpener.create()); in open()
89 openContext.storage().open(openContext.originalUri(), ReadStreamOpener.create()); in open()
90 OutputStream to = openContext.storage().open(cachedUri, WriteStreamOpener.create())) { in open()
94 file = openContext.storage().open(cachedUri, ReadFileOpener.create()); in open()
DWriteProtoOpener.java54 public Void open(OpenContext openContext) throws IOException { in open() argument
55 Uri tempUri = ScratchFile.scratchUri(openContext.encodedUri()); in open()
56 OutputStream backendOutput = openContext.backend().openForWrite(tempUri); in open()
57 List<OutputStream> chain = openContext.chainTransformsForWrite(backendOutput); in open()
72 openContext.backend().deleteFile(tempUri); in open()
81 openContext.backend().rename(tempUri, openContext.encodedUri()); in open()
DParcelFileDescriptorOpener.java41 public ParcelFileDescriptor open(OpenContext openContext) throws IOException { in open() argument
42 Pair<Uri, Closeable> result = openContext.backend().openForNativeRead(openContext.encodedUri()); in open()
44 if (openContext.hasTransforms()) { in open()
47 + openContext.originalUri()); in open()
DReadByteArrayOpener.java48 public byte[] open(OpenContext openContext) throws IOException { in open() argument
49 try (InputStream in = ReadStreamOpener.create().open(openContext)) { in open()
61 if (size == null && !openContext.hasTransforms()) { in open()
63 long fileSize = openContext.storage().fileSize(openContext.originalUri()); in open()
DNativeReadOpener.java49 public CloseableUri open(OpenContext openContext) throws IOException { in open() argument
50 Pair<Uri, Closeable> result = openContext.backend().openForNativeRead(openContext.encodedUri()); in open()
55 .encodedFragment(openContext.originalUri().getEncodedFragment()) in open()
DAppendStreamOpener.java48 public OutputStream open(OpenContext openContext) throws IOException { in open() argument
49 OutputStream backendOutput = openContext.backend().openForAppend(openContext.encodedUri()); in open()
50 List<OutputStream> chain = openContext.chainTransformsForAppend(backendOutput); in open()
DWriteStreamOpener.java46 public OutputStream open(OpenContext openContext) throws IOException { in open() argument
47 OutputStream backendOutput = openContext.backend().openForWrite(openContext.encodedUri()); in open()
48 List<OutputStream> chain = openContext.chainTransformsForWrite(backendOutput); in open()
DReadStreamOpener.java60 public InputStream open(OpenContext openContext) throws IOException { in open() argument
61 InputStream backendInput = openContext.backend().openForRead(openContext.encodedUri()); in open()
65 List<InputStream> chain = openContext.chainTransformsForRead(backendInput); in open()
DReadFileOpener.java111 public File open(OpenContext openContext) throws IOException { in open() argument
113 if (openContext.hasTransforms()) { in open()
116 return openContext.backend().toFile(openContext.encodedUri()); in open()
120 ReleasableResource.create(ReadStreamOpener.create().open(openContext))) { in open()
DRandomAccessFileOpener.java51 public RandomAccessFile open(OpenContext openContext) throws IOException { in open() argument
54 File file = readFileOpener.open(openContext); in open()
59 File file = readFileOpener.open(openContext); in open()
DMappedByteBufferOpener.java47 public MappedByteBuffer open(OpenContext openContext) throws IOException { in open() argument
49 try (InputStream stream = ReadStreamOpener.create().open(openContext)) { in open()
55 "URI not convertible to FileChannel for mapping: " + openContext.originalUri()); in open()
DIntegrityUriComputingOpener.java45 public Uri open(OpenContext openContext) throws IOException { in open() argument
46 Uri uri = openContext.originalUri(); in open()
51 openContext.storage().open(uri, ReadStreamOpener.create().withBehaviors(uriComputer))) { in open()
DRecursiveDeleteOpener.java67 public Void open(OpenContext openContext) throws IOException { in open() argument
69 deleteRecursively(openContext.storage(), openContext.encodedUri(), exceptions); in open()
DAssetFileDescriptorOpener.java39 public AssetFileDescriptor open(OpenContext openContext) throws IOException { in open() argument
41 ParcelFileDescriptor pfd = pfdOpener.open(openContext); in open()
DReadStringOpener.java42 public String open(OpenContext openContext) throws IOException { in open() argument
43 byte[] bytes = ReadByteArrayOpener.create().open(openContext); in open()
DWriteByteArrayOpener.java53 public Void open(OpenContext openContext) throws IOException { in open() argument
54 try (OutputStream out = WriteStreamOpener.create().withBehaviors(behaviors).open(openContext)) { in open()
DWriteStringOpener.java53 public Void open(OpenContext openContext) throws IOException { in open() argument
56 .open(openContext); in open()
DReadProtoOpener.java71 public T open(OpenContext openContext) throws IOException { in open() argument
72 try (InputStream in = ReadStreamOpener.create().open(openContext)) { in open()
DWriteFileOpener.java161 public FileCloser open(OpenContext openContext) throws IOException { in open() argument
163 ReleasableResource.create(WriteStreamOpener.create().open(openContext))) { in open()
/external/mobile-data-download/java/com/google/android/libraries/mobiledatadownload/file/integration/downloader/
DDownloadDestinationOpener.java167 public DownloadDestination open(OpenContext openContext) throws IOException { in open() argument
168 if (openContext.hasTransforms()) { in open()
170 "Transforms are not supported by this Opener: " + openContext.originalUri()); in open()
174 if (openContext.storage().isDirectory(openContext.originalUri())) { in open()
180 openContext.originalUri(), openContext.storage(), metadataStore); in open()
/external/mobile-data-download/java/com/google/android/libraries/mobiledatadownload/internal/downloader/
DZipFolderOpener.java50 public Void open(OpenContext openContext) throws IOException { in open() argument
51 SynchronousFileStorage fileStorage = openContext.storage(); in open()
53 new ZipInputStream(ReadStreamOpener.create().withBufferedIo().open(openContext))) { in open()
/external/mobile-data-download/java/com/google/android/libraries/mobiledatadownload/file/
DOpener.java32 T open(OpenContext openContext) throws IOException; in open() argument