123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435 |
- .class public final Lokhttp3/internal/cache/DiskLruCache$Editor;
- .super Ljava/lang/Object;
- .source ""
- # annotations
- .annotation system Ldalvik/annotation/EnclosingClass;
- value = Lokhttp3/internal/cache/DiskLruCache;
- .end annotation
- .annotation system Ldalvik/annotation/InnerClass;
- accessFlags = 0x11
- name = "Editor"
- .end annotation
- # instance fields
- .field private done:Z
- .field final entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- .field final synthetic this$0:Lokhttp3/internal/cache/DiskLruCache;
- .field final written:[Z
- # direct methods
- .method constructor <init>(Lokhttp3/internal/cache/DiskLruCache;Lokhttp3/internal/cache/DiskLruCache$Entry;)V
- .locals 0
- iput-object p1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- iput-object p2, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-boolean p2, p2, Lokhttp3/internal/cache/DiskLruCache$Entry;->readable:Z
- if-eqz p2, :cond_0
- const/4 p1, 0x0
- goto :goto_0
- :cond_0
- iget p1, p1, Lokhttp3/internal/cache/DiskLruCache;->valueCount:I
- new-array p1, p1, [Z
- :goto_0
- iput-object p1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->written:[Z
- return-void
- .end method
- # virtual methods
- .method public abort()V
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- monitor-enter v0
- :try_start_0
- iget-boolean v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->done:Z
- if-nez v1, :cond_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache$Entry;->currentEditor:Lokhttp3/internal/cache/DiskLruCache$Editor;
- if-ne v1, p0, :cond_0
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- const/4 v2, 0x0
- invoke-virtual {v1, p0, v2}, Lokhttp3/internal/cache/DiskLruCache;->completeEdit(Lokhttp3/internal/cache/DiskLruCache$Editor;Z)V
- :cond_0
- const/4 v1, 0x1
- iput-boolean v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->done:Z
- monitor-exit v0
- return-void
- :cond_1
- new-instance v1, Ljava/lang/IllegalStateException;
- invoke-direct {v1}, Ljava/lang/IllegalStateException;-><init>()V
- throw v1
- :catchall_0
- move-exception v1
- monitor-exit v0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- throw v1
- .end method
- .method public abortUnlessCommitted()V
- .locals 3
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- monitor-enter v0
- :try_start_0
- iget-boolean v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->done:Z
- if-nez v1, :cond_0
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache$Entry;->currentEditor:Lokhttp3/internal/cache/DiskLruCache$Editor;
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- if-ne v1, p0, :cond_0
- :try_start_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- const/4 v2, 0x0
- invoke-virtual {v1, p0, v2}, Lokhttp3/internal/cache/DiskLruCache;->completeEdit(Lokhttp3/internal/cache/DiskLruCache$Editor;Z)V
- :try_end_1
- .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- :catch_0
- :cond_0
- :try_start_2
- monitor-exit v0
- return-void
- :catchall_0
- move-exception v1
- monitor-exit v0
- :try_end_2
- .catchall {:try_start_2 .. :try_end_2} :catchall_0
- throw v1
- .end method
- .method public commit()V
- .locals 3
- .annotation system Ldalvik/annotation/Throws;
- value = {
- Ljava/io/IOException;
- }
- .end annotation
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- monitor-enter v0
- :try_start_0
- iget-boolean v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->done:Z
- if-nez v1, :cond_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache$Entry;->currentEditor:Lokhttp3/internal/cache/DiskLruCache$Editor;
- const/4 v2, 0x1
- if-ne v1, p0, :cond_0
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- invoke-virtual {v1, p0, v2}, Lokhttp3/internal/cache/DiskLruCache;->completeEdit(Lokhttp3/internal/cache/DiskLruCache$Editor;Z)V
- :cond_0
- iput-boolean v2, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->done:Z
- monitor-exit v0
- return-void
- :cond_1
- new-instance v1, Ljava/lang/IllegalStateException;
- invoke-direct {v1}, Ljava/lang/IllegalStateException;-><init>()V
- throw v1
- :catchall_0
- move-exception v1
- monitor-exit v0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- throw v1
- .end method
- .method detach()V
- .locals 3
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v0, v0, Lokhttp3/internal/cache/DiskLruCache$Entry;->currentEditor:Lokhttp3/internal/cache/DiskLruCache$Editor;
- if-ne v0, p0, :cond_1
- const/4 v0, 0x0
- :goto_0
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget v2, v1, Lokhttp3/internal/cache/DiskLruCache;->valueCount:I
- if-ge v0, v2, :cond_0
- :try_start_0
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache;->fileSystem:Lokhttp3/internal/io/FileSystem;
- iget-object v2, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v2, v2, Lokhttp3/internal/cache/DiskLruCache$Entry;->dirtyFiles:[Ljava/io/File;
- aget-object v2, v2, v0
- invoke-interface {v1, v2}, Lokhttp3/internal/io/FileSystem;->delete(Ljava/io/File;)V
- :try_end_0
- .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
- :catch_0
- add-int/lit8 v0, v0, 0x1
- goto :goto_0
- :cond_0
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- const/4 v1, 0x0
- iput-object v1, v0, Lokhttp3/internal/cache/DiskLruCache$Entry;->currentEditor:Lokhttp3/internal/cache/DiskLruCache$Editor;
- :cond_1
- return-void
- .end method
- .method public newSink(I)Lokio/Sink;
- .locals 3
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- monitor-enter v0
- :try_start_0
- iget-boolean v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->done:Z
- if-nez v1, :cond_2
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache$Entry;->currentEditor:Lokhttp3/internal/cache/DiskLruCache$Editor;
- if-eq v1, p0, :cond_0
- invoke-static {}, Lokio/Okio;->blackhole()Lokio/Sink;
- move-result-object p1
- monitor-exit v0
- return-object p1
- :cond_0
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-boolean v1, v1, Lokhttp3/internal/cache/DiskLruCache$Entry;->readable:Z
- if-nez v1, :cond_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->written:[Z
- const/4 v2, 0x1
- aput-boolean v2, v1, p1
- :cond_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache$Entry;->dirtyFiles:[Ljava/io/File;
- aget-object p1, v1, p1
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- :try_start_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache;->fileSystem:Lokhttp3/internal/io/FileSystem;
- invoke-interface {v1, p1}, Lokhttp3/internal/io/FileSystem;->sink(Ljava/io/File;)Lokio/Sink;
- move-result-object p1
- :try_end_1
- .catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_0
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- :try_start_2
- new-instance v1, Lokhttp3/internal/cache/DiskLruCache$Editor$1;
- invoke-direct {v1, p0, p1}, Lokhttp3/internal/cache/DiskLruCache$Editor$1;-><init>(Lokhttp3/internal/cache/DiskLruCache$Editor;Lokio/Sink;)V
- monitor-exit v0
- return-object v1
- :catch_0
- invoke-static {}, Lokio/Okio;->blackhole()Lokio/Sink;
- move-result-object p1
- monitor-exit v0
- return-object p1
- :cond_2
- new-instance p1, Ljava/lang/IllegalStateException;
- invoke-direct {p1}, Ljava/lang/IllegalStateException;-><init>()V
- throw p1
- :catchall_0
- move-exception p1
- monitor-exit v0
- :try_end_2
- .catchall {:try_start_2 .. :try_end_2} :catchall_0
- throw p1
- .end method
- .method public newSource(I)Lokio/Source;
- .locals 4
- iget-object v0, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- monitor-enter v0
- :try_start_0
- iget-boolean v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->done:Z
- if-nez v1, :cond_2
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-boolean v1, v1, Lokhttp3/internal/cache/DiskLruCache$Entry;->readable:Z
- const/4 v2, 0x0
- if-eqz v1, :cond_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache$Entry;->currentEditor:Lokhttp3/internal/cache/DiskLruCache$Editor;
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- if-eq v1, p0, :cond_0
- goto :goto_0
- :cond_0
- :try_start_1
- iget-object v1, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->this$0:Lokhttp3/internal/cache/DiskLruCache;
- iget-object v1, v1, Lokhttp3/internal/cache/DiskLruCache;->fileSystem:Lokhttp3/internal/io/FileSystem;
- iget-object v3, p0, Lokhttp3/internal/cache/DiskLruCache$Editor;->entry:Lokhttp3/internal/cache/DiskLruCache$Entry;
- iget-object v3, v3, Lokhttp3/internal/cache/DiskLruCache$Entry;->cleanFiles:[Ljava/io/File;
- aget-object p1, v3, p1
- invoke-interface {v1, p1}, Lokhttp3/internal/io/FileSystem;->source(Ljava/io/File;)Lokio/Source;
- move-result-object p1
- :try_end_1
- .catch Ljava/io/FileNotFoundException; {:try_start_1 .. :try_end_1} :catch_0
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- :try_start_2
- monitor-exit v0
- return-object p1
- :catch_0
- monitor-exit v0
- return-object v2
- :cond_1
- :goto_0
- monitor-exit v0
- return-object v2
- :cond_2
- new-instance p1, Ljava/lang/IllegalStateException;
- invoke-direct {p1}, Ljava/lang/IllegalStateException;-><init>()V
- throw p1
- :catchall_0
- move-exception p1
- monitor-exit v0
- :try_end_2
- .catchall {:try_start_2 .. :try_end_2} :catchall_0
- throw p1
- .end method
|