.class public final Lokhttp3/internal/http2/Http2Server; .super Lokhttp3/internal/http2/Http2Connection$Listener; .source "" # static fields .field static final logger:Ljava/util/logging/Logger; # instance fields .field private final baseDirectory:Ljava/io/File; .field private final sslSocketFactory:Ljavax/net/ssl/SSLSocketFactory; # direct methods .method static constructor ()V .locals 1 const-class v0, Lokhttp3/internal/http2/Http2Server; invoke-virtual {v0}, Ljava/lang/Class;->getName()Ljava/lang/String; move-result-object v0 invoke-static {v0}, Ljava/util/logging/Logger;->getLogger(Ljava/lang/String;)Ljava/util/logging/Logger; move-result-object v0 sput-object v0, Lokhttp3/internal/http2/Http2Server;->logger:Ljava/util/logging/Logger; return-void .end method .method public constructor (Ljava/io/File;Ljavax/net/ssl/SSLSocketFactory;)V .locals 0 invoke-direct {p0}, Lokhttp3/internal/http2/Http2Connection$Listener;->()V iput-object p1, p0, Lokhttp3/internal/http2/Http2Server;->baseDirectory:Ljava/io/File; iput-object p2, p0, Lokhttp3/internal/http2/Http2Server;->sslSocketFactory:Ljavax/net/ssl/SSLSocketFactory; return-void .end method .method private contentType(Ljava/io/File;)Ljava/lang/String; .locals 3 invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v0 const-string v1, ".css" invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z move-result v0 if-eqz v0, :cond_0 const-string p1, "text/css" return-object p1 :cond_0 invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v0 const-string v1, ".gif" invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z move-result v0 if-eqz v0, :cond_1 const-string p1, "image/gif" return-object p1 :cond_1 invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v0 const-string v1, ".html" invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z move-result v0 if-eqz v0, :cond_2 const-string p1, "text/html" return-object p1 :cond_2 invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v0 const-string v1, ".jpeg" invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z move-result v0 const-string v1, "image/jpeg" if-eqz v0, :cond_3 return-object v1 :cond_3 invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v0 const-string v2, ".jpg" invoke-virtual {v0, v2}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z move-result v0 if-eqz v0, :cond_4 return-object v1 :cond_4 invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v0 const-string v1, ".js" invoke-virtual {v0, v1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z move-result v0 if-eqz v0, :cond_5 const-string p1, "application/javascript" return-object p1 :cond_5 invoke-virtual {p1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object p1 const-string v0, ".png" invoke-virtual {p1, v0}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z move-result p1 if-eqz p1, :cond_6 const-string p1, "image/png" return-object p1 :cond_6 const-string p1, "text/plain" return-object p1 .end method .method private doSsl(Ljava/net/Socket;)Ljavax/net/ssl/SSLSocket; .locals 4 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation iget-object v0, p0, Lokhttp3/internal/http2/Http2Server;->sslSocketFactory:Ljavax/net/ssl/SSLSocketFactory; invoke-virtual {p1}, Ljava/net/Socket;->getInetAddress()Ljava/net/InetAddress; move-result-object v1 invoke-virtual {v1}, Ljava/net/InetAddress;->getHostAddress()Ljava/lang/String; move-result-object v1 invoke-virtual {p1}, Ljava/net/Socket;->getPort()I move-result v2 const/4 v3, 0x1 invoke-virtual {v0, p1, v1, v2, v3}, Ljavax/net/ssl/SSLSocketFactory;->createSocket(Ljava/net/Socket;Ljava/lang/String;IZ)Ljava/net/Socket; move-result-object p1 check-cast p1, Ljavax/net/ssl/SSLSocket; const/4 v0, 0x0 invoke-virtual {p1, v0}, Ljavax/net/ssl/SSLSocket;->setUseClientMode(Z)V invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object v0 sget-object v1, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol; invoke-static {v1}, Ljava/util/Collections;->singletonList(Ljava/lang/Object;)Ljava/util/List; move-result-object v1 const/4 v2, 0x0 invoke-virtual {v0, p1, v2, v1}, Lokhttp3/internal/platform/Platform;->configureTlsExtensions(Ljavax/net/ssl/SSLSocket;Ljava/lang/String;Ljava/util/List;)V invoke-virtual {p1}, Ljavax/net/ssl/SSLSocket;->startHandshake()V return-object p1 .end method .method public static varargs main([Ljava/lang/String;)V .locals 3 .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/Exception; } .end annotation array-length v0, p0 const/4 v1, 0x1 if-ne v0, v1, :cond_1 const/4 v0, 0x0 aget-object v1, p0, v0 const-string v2, "-" invoke-virtual {v1, v2}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z move-result v1 if-eqz v1, :cond_0 goto :goto_0 :cond_0 new-instance v1, Lokhttp3/internal/http2/Http2Server; new-instance v2, Ljava/io/File; aget-object p0, p0, v0 invoke-direct {v2, p0}, Ljava/io/File;->(Ljava/lang/String;)V invoke-static {}, Lokhttp3/internal/tls/SslClient;->localhost()Lokhttp3/internal/tls/SslClient; move-result-object p0 iget-object p0, p0, Lokhttp3/internal/tls/SslClient;->sslContext:Ljavax/net/ssl/SSLContext; invoke-virtual {p0}, Ljavax/net/ssl/SSLContext;->getSocketFactory()Ljavax/net/ssl/SSLSocketFactory; move-result-object p0 invoke-direct {v1, v2, p0}, Lokhttp3/internal/http2/Http2Server;->(Ljava/io/File;Ljavax/net/ssl/SSLSocketFactory;)V invoke-direct {v1}, Lokhttp3/internal/http2/Http2Server;->run()V return-void :cond_1 :goto_0 sget-object p0, Ljava/lang/System;->out:Ljava/io/PrintStream; const-string v0, "Usage: Http2Server " invoke-virtual {p0, v0}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V return-void .end method .method private run()V .locals 8 .annotation system Ldalvik/annotation/Throws; value = { Ljava/lang/Exception; } .end annotation new-instance v0, Ljava/net/ServerSocket; const/16 v1, 0x22b8 invoke-direct {v0, v1}, Ljava/net/ServerSocket;->(I)V const/4 v1, 0x1 invoke-virtual {v0, v1}, Ljava/net/ServerSocket;->setReuseAddress(Z)V :goto_0 const/4 v1, 0x0 :try_start_0 invoke-virtual {v0}, Ljava/net/ServerSocket;->accept()Ljava/net/Socket; move-result-object v2 :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_3 .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2 :try_start_1 invoke-direct {p0, v2}, Lokhttp3/internal/http2/Http2Server;->doSsl(Ljava/net/Socket;)Ljavax/net/ssl/SSLSocket; move-result-object v3 invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object v4 invoke-virtual {v4, v3}, Lokhttp3/internal/platform/Platform;->getSelectedProtocol(Ljavax/net/ssl/SSLSocket;)Ljava/lang/String; move-result-object v4 if-eqz v4, :cond_0 invoke-static {v4}, Lokhttp3/Protocol;->get(Ljava/lang/String;)Lokhttp3/Protocol; move-result-object v1 :cond_0 sget-object v4, Lokhttp3/Protocol;->HTTP_2:Lokhttp3/Protocol; if-ne v1, v4, :cond_1 new-instance v1, Lokhttp3/internal/http2/Http2Connection$Builder; const/4 v4, 0x0 invoke-direct {v1, v4}, Lokhttp3/internal/http2/Http2Connection$Builder;->(Z)V invoke-virtual {v1, v3}, Lokhttp3/internal/http2/Http2Connection$Builder;->socket(Ljava/net/Socket;)Lokhttp3/internal/http2/Http2Connection$Builder; move-result-object v1 invoke-virtual {v1, p0}, Lokhttp3/internal/http2/Http2Connection$Builder;->listener(Lokhttp3/internal/http2/Http2Connection$Listener;)Lokhttp3/internal/http2/Http2Connection$Builder; move-result-object v1 invoke-virtual {v1}, Lokhttp3/internal/http2/Http2Connection$Builder;->build()Lokhttp3/internal/http2/Http2Connection; move-result-object v1 invoke-virtual {v1}, Lokhttp3/internal/http2/Http2Connection;->start()V goto :goto_0 :cond_1 new-instance v3, Ljava/net/ProtocolException; new-instance v4, Ljava/lang/StringBuilder; invoke-direct {v4}, Ljava/lang/StringBuilder;->()V const-string v5, "Protocol " invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; const-string v1, " unsupported" invoke-virtual {v4, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 invoke-direct {v3, v1}, Ljava/net/ProtocolException;->(Ljava/lang/String;)V throw v3 :try_end_1 .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1 .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0 :catch_0 move-exception v1 goto :goto_1 :catch_1 move-exception v1 goto :goto_2 :catch_2 move-exception v2 move-object v7, v2 move-object v2, v1 move-object v1, v7 :goto_1 sget-object v3, Lokhttp3/internal/http2/Http2Server;->logger:Ljava/util/logging/Logger; sget-object v4, Ljava/util/logging/Level;->WARNING:Ljava/util/logging/Level; const-string v5, "Http2Server unexpected failure" invoke-virtual {v3, v4, v5, v1}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;Ljava/lang/Throwable;)V goto :goto_3 :catch_3 move-exception v2 move-object v7, v2 move-object v2, v1 move-object v1, v7 :goto_2 sget-object v3, Lokhttp3/internal/http2/Http2Server;->logger:Ljava/util/logging/Logger; sget-object v4, Ljava/util/logging/Level;->INFO:Ljava/util/logging/Level; new-instance v5, Ljava/lang/StringBuilder; invoke-direct {v5}, Ljava/lang/StringBuilder;->()V const-string v6, "Http2Server connection failure: " invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v5, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 invoke-virtual {v3, v4, v1}, Ljava/util/logging/Logger;->log(Ljava/util/logging/Level;Ljava/lang/String;)V :goto_3 invoke-static {v2}, Lokhttp3/internal/Util;->closeQuietly(Ljava/net/Socket;)V goto :goto_0 .end method .method private send404(Lokhttp3/internal/http2/Http2Stream;Ljava/lang/String;)V .locals 5 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x3 new-array v0, v0, [Lokhttp3/internal/http2/Header; new-instance v1, Lokhttp3/internal/http2/Header; const-string v2, ":status" const-string v3, "404" invoke-direct {v1, v2, v3}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v2, 0x0 aput-object v1, v0, v2 new-instance v1, Lokhttp3/internal/http2/Header; const-string v2, ":version" const-string v3, "HTTP/1.1" invoke-direct {v1, v2, v3}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v2, 0x1 aput-object v1, v0, v2 new-instance v1, Lokhttp3/internal/http2/Header; const-string v3, "content-type" const-string v4, "text/plain" invoke-direct {v1, v3, v4}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v3, 0x2 aput-object v1, v0, v3 invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List; move-result-object v0 invoke-virtual {p1, v0, v2}, Lokhttp3/internal/http2/Http2Stream;->sendResponseHeaders(Ljava/util/List;Z)V invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Stream;->getSink()Lokio/Sink; move-result-object p1 invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink; move-result-object p1 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v1, "Not found: " invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p2 invoke-interface {p1, p2}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink; invoke-interface {p1}, Lokio/Sink;->close()V return-void .end method .method private serveDirectory(Lokhttp3/internal/http2/Http2Stream;[Ljava/io/File;)V .locals 6 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x3 new-array v0, v0, [Lokhttp3/internal/http2/Header; new-instance v1, Lokhttp3/internal/http2/Header; const-string v2, ":status" const-string v3, "200" invoke-direct {v1, v2, v3}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v2, 0x0 aput-object v1, v0, v2 new-instance v1, Lokhttp3/internal/http2/Header; const-string v3, ":version" const-string v4, "HTTP/1.1" invoke-direct {v1, v3, v4}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v3, 0x1 aput-object v1, v0, v3 new-instance v1, Lokhttp3/internal/http2/Header; const-string v4, "content-type" const-string v5, "text/html; charset=UTF-8" invoke-direct {v1, v4, v5}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v4, 0x2 aput-object v1, v0, v4 invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List; move-result-object v0 invoke-virtual {p1, v0, v3}, Lokhttp3/internal/http2/Http2Stream;->sendResponseHeaders(Ljava/util/List;Z)V invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Stream;->getSink()Lokio/Sink; move-result-object p1 invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink; move-result-object p1 array-length v0, p2 :goto_0 if-ge v2, v0, :cond_1 aget-object v1, p2, v2 invoke-virtual {v1}, Ljava/io/File;->isDirectory()Z move-result v3 if-eqz v3, :cond_0 new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;->()V invoke-virtual {v1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v1 invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v1, "/" invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 goto :goto_1 :cond_0 invoke-virtual {v1}, Ljava/io/File;->getName()Ljava/lang/String; move-result-object v1 :goto_1 new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;->()V const-string v4, "append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v4, "\'>" invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; const-string v1, "
" invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 invoke-interface {p1, v1}, Lokio/BufferedSink;->writeUtf8(Ljava/lang/String;)Lokio/BufferedSink; add-int/lit8 v2, v2, 0x1 goto :goto_0 :cond_1 invoke-interface {p1}, Lokio/Sink;->close()V return-void .end method .method private serveFile(Lokhttp3/internal/http2/Http2Stream;Ljava/io/File;)V .locals 5 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x3 new-array v0, v0, [Lokhttp3/internal/http2/Header; new-instance v1, Lokhttp3/internal/http2/Header; const-string v2, ":status" const-string v3, "200" invoke-direct {v1, v2, v3}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v2, 0x0 aput-object v1, v0, v2 new-instance v1, Lokhttp3/internal/http2/Header; const-string v2, ":version" const-string v3, "HTTP/1.1" invoke-direct {v1, v2, v3}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v2, 0x1 aput-object v1, v0, v2 new-instance v1, Lokhttp3/internal/http2/Header; invoke-direct {p0, p2}, Lokhttp3/internal/http2/Http2Server;->contentType(Ljava/io/File;)Ljava/lang/String; move-result-object v3 const-string v4, "content-type" invoke-direct {v1, v4, v3}, Lokhttp3/internal/http2/Header;->(Ljava/lang/String;Ljava/lang/String;)V const/4 v3, 0x2 aput-object v1, v0, v3 invoke-static {v0}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List; move-result-object v0 invoke-virtual {p1, v0, v2}, Lokhttp3/internal/http2/Http2Stream;->sendResponseHeaders(Ljava/util/List;Z)V invoke-static {p2}, Lokio/Okio;->source(Ljava/io/File;)Lokio/Source; move-result-object p2 :try_start_0 invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Stream;->getSink()Lokio/Sink; move-result-object p1 invoke-static {p1}, Lokio/Okio;->buffer(Lokio/Sink;)Lokio/BufferedSink; move-result-object p1 invoke-interface {p1, p2}, Lokio/BufferedSink;->writeAll(Lokio/Source;)J invoke-interface {p1}, Lokio/Sink;->close()V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 invoke-static {p2}, Lokhttp3/internal/Util;->closeQuietly(Ljava/io/Closeable;)V return-void :catchall_0 move-exception p1 invoke-static {p2}, Lokhttp3/internal/Util;->closeQuietly(Ljava/io/Closeable;)V throw p1 .end method # virtual methods .method public onStream(Lokhttp3/internal/http2/Http2Stream;)V .locals 6 .annotation system Ldalvik/annotation/Throws; value = { Ljava/io/IOException; } .end annotation const/4 v0, 0x0 :try_start_0 invoke-virtual {p1}, Lokhttp3/internal/http2/Http2Stream;->getRequestHeaders()Ljava/util/List; move-result-object v1 const/4 v2, 0x0 invoke-interface {v1}, Ljava/util/List;->size()I move-result v3 :goto_0 if-ge v2, v3, :cond_1 invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v4 check-cast v4, Lokhttp3/internal/http2/Header; iget-object v4, v4, Lokhttp3/internal/http2/Header;->name:Lokio/ByteString; sget-object v5, Lokhttp3/internal/http2/Header;->TARGET_PATH:Lokio/ByteString; invoke-virtual {v4, v5}, Lokio/ByteString;->equals(Ljava/lang/Object;)Z move-result v4 if-eqz v4, :cond_0 invoke-interface {v1, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v1 check-cast v1, Lokhttp3/internal/http2/Header; iget-object v1, v1, Lokhttp3/internal/http2/Header;->value:Lokio/ByteString; invoke-virtual {v1}, Lokio/ByteString;->utf8()Ljava/lang/String; move-result-object v1 goto :goto_1 :cond_0 add-int/lit8 v2, v2, 0x1 goto :goto_0 :cond_1 move-object v1, v0 :goto_1 if-eqz v1, :cond_4 new-instance v2, Ljava/io/File; new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;->()V iget-object v4, p0, Lokhttp3/internal/http2/Http2Server;->baseDirectory:Ljava/io/File; invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v3 invoke-direct {v2, v3}, Ljava/io/File;->(Ljava/lang/String;)V invoke-virtual {v2}, Ljava/io/File;->isDirectory()Z move-result v3 if-eqz v3, :cond_2 invoke-virtual {v2}, Ljava/io/File;->listFiles()[Ljava/io/File; move-result-object v1 invoke-direct {p0, p1, v1}, Lokhttp3/internal/http2/Http2Server;->serveDirectory(Lokhttp3/internal/http2/Http2Stream;[Ljava/io/File;)V goto :goto_2 :cond_2 invoke-virtual {v2}, Ljava/io/File;->exists()Z move-result v3 if-eqz v3, :cond_3 invoke-direct {p0, p1, v2}, Lokhttp3/internal/http2/Http2Server;->serveFile(Lokhttp3/internal/http2/Http2Stream;Ljava/io/File;)V goto :goto_2 :cond_3 invoke-direct {p0, p1, v1}, Lokhttp3/internal/http2/Http2Server;->send404(Lokhttp3/internal/http2/Http2Stream;Ljava/lang/String;)V goto :goto_2 :cond_4 new-instance p1, Ljava/lang/AssertionError; invoke-direct {p1}, Ljava/lang/AssertionError;->()V throw p1 :try_end_0 .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0 :catch_0 move-exception p1 invoke-static {}, Lokhttp3/internal/platform/Platform;->get()Lokhttp3/internal/platform/Platform; move-result-object v1 const/4 v2, 0x4 new-instance v3, Ljava/lang/StringBuilder; invoke-direct {v3}, Ljava/lang/StringBuilder;->()V const-string v4, "Failure serving Http2Stream: " invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {p1}, Ljava/io/IOException;->getMessage()Ljava/lang/String; move-result-object p1 invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p1 invoke-virtual {v1, v2, p1, v0}, Lokhttp3/internal/platform/Platform;->log(ILjava/lang/String;Ljava/lang/Throwable;)V :goto_2 return-void .end method