Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
24ab2b37
Commit
24ab2b37
authored
Aug 23, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete app/src/main/java/chat/rocket/android/helper/OkHttpHelper.java
parent
8de677fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
51 deletions
+0
-51
OkHttpHelper.java
...rc/main/java/chat/rocket/android/helper/OkHttpHelper.java
+0
-51
No files found.
app/src/main/java/chat/rocket/android/helper/OkHttpHelper.java
deleted
100644 → 0
View file @
8de677fa
package
chat
.
rocket
.
android
.
helper
;
import
android.content.Context
;
import
com.facebook.stetho.okhttp3.StethoInterceptor
;
import
java.util.concurrent.TimeUnit
;
import
chat.rocket.android.RocketChatCache
;
import
chat.rocket.android.api.rest.CookieInterceptor
;
import
chat.rocket.android.api.rest.DefaultCookieProvider
;
import
okhttp3.OkHttpClient
;
/**
* Helper class for OkHttp client.
*/
public
class
OkHttpHelper
{
private
static
OkHttpClient
httpClientForUploadFile
;
private
static
OkHttpClient
httpClientForDownloadFile
;
private
static
OkHttpClient
httpClientForWS
;
public
static
OkHttpClient
getClientForDownloadFile
(
Context
context
)
{
if
(
httpClientForDownloadFile
==
null
)
{
httpClientForDownloadFile
=
new
OkHttpClient
.
Builder
()
.
addNetworkInterceptor
(
new
StethoInterceptor
())
.
addInterceptor
(
new
CookieInterceptor
(
new
DefaultCookieProvider
(
new
RocketChatCache
(
context
))))
.
build
();
}
return
httpClientForDownloadFile
;
}
public
static
OkHttpClient
getClientForUploadFile
()
{
if
(
httpClientForUploadFile
==
null
)
{
httpClientForUploadFile
=
new
OkHttpClient
.
Builder
()
.
addNetworkInterceptor
(
new
StethoInterceptor
())
.
build
();
}
return
httpClientForUploadFile
;
}
/**
* acquire OkHttpClient instance for WebSocket connection.
*/
public
static
OkHttpClient
getClientForWebSocket
()
{
if
(
httpClientForWS
==
null
)
{
httpClientForWS
=
new
OkHttpClient
.
Builder
().
readTimeout
(
0
,
TimeUnit
.
NANOSECONDS
)
.
addNetworkInterceptor
(
new
StethoInterceptor
())
.
build
();
}
return
httpClientForWS
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment