Warning: session_start(): open(/var/lib/php/sessions/sess_5oc2n7eib3b5p7b2d1h101f967, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51

Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
serveFile_maxCache - serve a file within serveHttp with maximum caching [1007563]

Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1007563 // serveFile_maxCache - serve a file within serveHttp with maximum caching

JavaX fragment (include)

static NanoHTTPD.Response serveFile_maxCache(File file) {
  ret serveFile(file, "application/octet-stream");
}

static NanoHTTPD.Response serveFile_maxCache(File file, S mimeType) ctex {
  ret maxCacheHeaders(NanoHTTPD.newFixedLengthResponse(NanoHTTPD.Status.OK, mimeType, new FileInputStream(file), file.length()));
}

Author comment

Began life as a copy of #1003197

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1007563
Snippet name: serveFile_maxCache - serve a file within serveHttp with maximum caching
Eternal ID of this version: #1007563/2
Text MD5: 5dbf24a962bea32958aafcbeef70cb38
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-27 15:56:43
Source code size: 324 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 854 / 888
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)