Advanced Configuration
grizzly-sendfile's characteristics can be configured via different settings. Currently these settings should be specified as JVM options/parameters:
AllowedPaths
| jvm option
| -Dcom.igorminar.grizzlysendfile.AllowedPaths |
| description
| specifies path(s) from which grizzly-sendfile is allowed to serve files. This is a security measure that prevents system or otherwise restricted files to be served by grizzly-sendfile.
|
| required
| yes
|
| default
| -
|
| notes
| comma separated list of paths. In order to specify the entire directory always end the path with /*, which is used for simple globbing |
| since
| 0.2
|
| examples
| -Dcom.igorminar.grizzlysendfile.AllowedPaths=/var/www/files/*
-Dcom.igorminar.grizzlysendfile.AllowedPaths=/var/www/files/*,/var/www/images/*.jpg |
Algorithm
| jvm option
| -Dcom.igorminar.grizzlysendfile.Algorithm |
| description
| grizzly-sendfile algorithm used
|
| required
| no
|
| default
| com.igorminar.grizzlysendfile.algorithm.EqualBlockingAlgorithm |
| since
| 0.2
|
| examples
| -Dcom.igorminar.grizzlysendfile.Algorithm=com.igorminar.grizzlysendfile.algorithm.EqualNonBlockingAlgorithm |
ThreadCount
| jvm option
| -Dcom.igorminar.grizzlysendfile.ThreadCount |
| description
| maximum number of worker threads in the thread pool
|
| required
| no
|
| default
| 50 |
| since
| 0.2
|
| examples
| -Dcom.igorminar.grizzlysendfile.ThreadCount=100 |
BufferSize
| jvm option
| -Dcom.igorminar.grizzlysendfile.BufferSize |
| description
| size of a buffer in bytes used as a temporary storage of data between reading the data from the file and sending it to the client. If set to 0, the buffer size will be set to the system specific socket send buffer size], which usually yields the best results.
|
| required
| no
|
| default
| 0 (System Specific, e.g. on MacOS X it is set to 81KB)
|
| since
| 0.2
|
| examples
| -Dcom.igorminar.grizzlysendfile.BufferSize=32000 |
IdleConnectionTimeout
| jvm option
| -Dcom.igorminar.grizzlysendfile.IdleConnectionTimeout |
| description
| maximum duration in milliseconds that a connection can be idle before it is closed by grizzly-sendfile.
|
| required
| no
|
| default
| 30000 (30sec)
|
| since
| 0.2
|
| examples
| -Dcom.igorminar.grizzlysendfile.IdleConnectionTimeout=60000 (60sec) -Dcom.igorminar.grizzlysendfile.IdleConnectionTimeout=-1 (unlimited)
|
Plugins
| jvm option
| -Dcom.igorminar.grizzlysendfile.Plugins |
| description
| comma separated list of plugins that grizzly-sendfile should load (order matters!)
|
| required
| no
|
| default
| -
|
| since
| 0.2
|
| examples
| -Dcom.igorminar.grizzlysendfile.Plugins=com.igorminar.grizzlysendfile.plugin.DownloadResultSender
-Dcom.igorminar.grizzlysendfile.Plugins=com.igorminar.grizzlysendfile.plugin.DownloadResultSender, foo.bar.BazPlugin |
AutoSendfileUriPrefix
| jvm option
| -Dcom.igorminar.grizzlysendfile.AutoSendfileUriPrefix |
| description
| in combination with AutoSendfileFileDir turns on the AutoSendfile mode. All requests with the specified prefix will be intercepted and handled by grizzly-sendfile dirrectly.
|
| required
| no
|
| default
| -
|
| since
| 0.3
|
| examples
| -Dcom.igorminar.grizzlysendfile.AutoSendfileUriPrefix=/files
-Dcom.igorminar.grizzlysendfile.AutoSendfileUriPrefix=/ |
AutoSendfileFileDir
| jvm option
| -Dcom.igorminar.grizzlysendfile.AutoSendfileFileDir |
| description
| in combination with AutoSendfileUriPrefix turns on the AutoSendfile mode. The files under the specified directory will be exposed via the AutoSendfileUriPrefix URI.
|
| required
| no
|
| default
| -
|
| since
| 0.3
|
| examples
| -Dcom.igorminar.grizzlysendfile.AutoSendfileUriPrefix=/var/www/large-files/ |