Cache$2.smali 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. .class Lokhttp3/Cache$2;
  2. .super Ljava/lang/Object;
  3. .source ""
  4. # interfaces
  5. .implements Ljava/util/Iterator;
  6. # annotations
  7. .annotation system Ldalvik/annotation/EnclosingMethod;
  8. value = Lokhttp3/Cache;->urls()Ljava/util/Iterator;
  9. .end annotation
  10. .annotation system Ldalvik/annotation/InnerClass;
  11. accessFlags = 0x0
  12. name = null
  13. .end annotation
  14. .annotation system Ldalvik/annotation/Signature;
  15. value = {
  16. "Ljava/lang/Object;",
  17. "Ljava/util/Iterator<",
  18. "Ljava/lang/String;",
  19. ">;"
  20. }
  21. .end annotation
  22. # instance fields
  23. .field canRemove:Z
  24. .field final delegate:Ljava/util/Iterator;
  25. .annotation system Ldalvik/annotation/Signature;
  26. value = {
  27. "Ljava/util/Iterator<",
  28. "Lokhttp3/internal/cache/DiskLruCache$Snapshot;",
  29. ">;"
  30. }
  31. .end annotation
  32. .end field
  33. .field nextUrl:Ljava/lang/String;
  34. .field final synthetic this$0:Lokhttp3/Cache;
  35. # direct methods
  36. .method constructor <init>(Lokhttp3/Cache;)V
  37. .locals 0
  38. .annotation system Ldalvik/annotation/Throws;
  39. value = {
  40. Ljava/io/IOException;
  41. }
  42. .end annotation
  43. iput-object p1, p0, Lokhttp3/Cache$2;->this$0:Lokhttp3/Cache;
  44. invoke-direct {p0}, Ljava/lang/Object;-><init>()V
  45. iget-object p1, p0, Lokhttp3/Cache$2;->this$0:Lokhttp3/Cache;
  46. iget-object p1, p1, Lokhttp3/Cache;->cache:Lokhttp3/internal/cache/DiskLruCache;
  47. invoke-virtual {p1}, Lokhttp3/internal/cache/DiskLruCache;->snapshots()Ljava/util/Iterator;
  48. move-result-object p1
  49. iput-object p1, p0, Lokhttp3/Cache$2;->delegate:Ljava/util/Iterator;
  50. return-void
  51. .end method
  52. # virtual methods
  53. .method public hasNext()Z
  54. .locals 4
  55. iget-object v0, p0, Lokhttp3/Cache$2;->nextUrl:Ljava/lang/String;
  56. const/4 v1, 0x1
  57. if-eqz v0, :cond_0
  58. return v1
  59. :cond_0
  60. const/4 v0, 0x0
  61. iput-boolean v0, p0, Lokhttp3/Cache$2;->canRemove:Z
  62. :goto_0
  63. iget-object v2, p0, Lokhttp3/Cache$2;->delegate:Ljava/util/Iterator;
  64. invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
  65. move-result v2
  66. if-eqz v2, :cond_1
  67. iget-object v2, p0, Lokhttp3/Cache$2;->delegate:Ljava/util/Iterator;
  68. invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
  69. move-result-object v2
  70. check-cast v2, Lokhttp3/internal/cache/DiskLruCache$Snapshot;
  71. :try_start_0
  72. invoke-virtual {v2, v0}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->getSource(I)Lokio/Source;
  73. move-result-object v3
  74. invoke-static {v3}, Lokio/Okio;->buffer(Lokio/Source;)Lokio/BufferedSource;
  75. move-result-object v3
  76. invoke-interface {v3}, Lokio/BufferedSource;->readUtf8LineStrict()Ljava/lang/String;
  77. move-result-object v3
  78. iput-object v3, p0, Lokhttp3/Cache$2;->nextUrl:Ljava/lang/String;
  79. :try_end_0
  80. .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
  81. .catchall {:try_start_0 .. :try_end_0} :catchall_0
  82. invoke-virtual {v2}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->close()V
  83. return v1
  84. :catchall_0
  85. move-exception v0
  86. invoke-virtual {v2}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->close()V
  87. throw v0
  88. :catch_0
  89. invoke-virtual {v2}, Lokhttp3/internal/cache/DiskLruCache$Snapshot;->close()V
  90. goto :goto_0
  91. :cond_1
  92. return v0
  93. .end method
  94. .method public bridge synthetic next()Ljava/lang/Object;
  95. .locals 1
  96. invoke-virtual {p0}, Lokhttp3/Cache$2;->next()Ljava/lang/String;
  97. move-result-object v0
  98. return-object v0
  99. .end method
  100. .method public next()Ljava/lang/String;
  101. .locals 2
  102. invoke-virtual {p0}, Lokhttp3/Cache$2;->hasNext()Z
  103. move-result v0
  104. if-eqz v0, :cond_0
  105. iget-object v0, p0, Lokhttp3/Cache$2;->nextUrl:Ljava/lang/String;
  106. const/4 v1, 0x0
  107. iput-object v1, p0, Lokhttp3/Cache$2;->nextUrl:Ljava/lang/String;
  108. const/4 v1, 0x1
  109. iput-boolean v1, p0, Lokhttp3/Cache$2;->canRemove:Z
  110. return-object v0
  111. :cond_0
  112. new-instance v0, Ljava/util/NoSuchElementException;
  113. invoke-direct {v0}, Ljava/util/NoSuchElementException;-><init>()V
  114. throw v0
  115. .end method
  116. .method public remove()V
  117. .locals 2
  118. iget-boolean v0, p0, Lokhttp3/Cache$2;->canRemove:Z
  119. if-eqz v0, :cond_0
  120. iget-object v0, p0, Lokhttp3/Cache$2;->delegate:Ljava/util/Iterator;
  121. invoke-interface {v0}, Ljava/util/Iterator;->remove()V
  122. return-void
  123. :cond_0
  124. new-instance v0, Ljava/lang/IllegalStateException;
  125. const-string v1, "remove() before next()"
  126. invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
  127. throw v0
  128. .end method