Wiki

Clone wiki

Zip Extractor / Home

# ZipExtractor

##Contents## * Feature List * Commands * Additional Command Information * Permissions * Permission Tree * Configuration File * Screenshots


ZipExtractor is an administrative utility plugin allowing the compression/extraction of archived files through minecraft command. This plugin is extremely useful for dealing with archives over FTP, which does not provide support for neither compression nor extraction. While using this plugin please note that there is no undo button. Overridden files cannot be recovered.

The source and destination file paths are saved inside of the config.yml. This means that only one can be set at a time. If you edit these values directly in the config.yml you must reload the plugin for the new values to take effect.


#Feature List

  • Extraction of ZIP, RAR, and JAR archives.
  • Compression of any file into the ZIP format.
  • Queueable operations if you have many extractions/compressions to perform.
  • Configurable Thread Pool Executor allowing you to set a maximum queue size and maximum number of threads to run at once. Incase of an emergency the Thread Pool can be shutdown at anytime.
  • Option to be warned if an extraction/compression would result in files being overriden.
    • If enabled, users will require an additional permission in order to proceed with the process.
    • For extractions, you can view every file which would be overriden prior to proceeding with the process.
  • Metrics by bStats

#Commands

All commands can be run using /ZipExtractor or the shorter alias /ze.

Command Description Required Permission
/ze help [cmd] View the command list or more information on a specific command. To view more information on a command replace [cmd] with the name of said command. zipextractor.admin.use
/ze extract Begin an extraction process. The source file will be extracted into the destination directory. zipextractor.admin.extract
/ze extract view [page] If a process was halted because it could result in overriden files, you may use this command to view exactly which files would be overriden. The files are listed as relative paths with respect to the destination directory. zipextractor.admin.extract
/ze compress Begin a compression process. The source file/directory will be compressed to the destination path as a zip archive. zipextractor.admin.compress
/ze src [-absolute] View the currently defined source path. If you pass the -absolute parameter the path will be an absolute path as defined by the File System. zipextractor.admin.src
/ze dest [-absolute] View the currently defined destination path. If you pass the -absolute parameter the path will be an absolute path as defined by the File System. zipextractor.admin.dest
/ze setsrc <path> Define the source file path. This can be either a relative or absolute path. zipextractor.admin.setsrc
/ze setdest <path> Define the destination file path. This can be either a relative or absolute path. zipextractor.admin.setdest
/ze status This command will display the status of the executor service. If the service has not been terminated, the number of active and queued processes will be displayed. zipextractor.harmless.status
/ze plugindir View the absolute path of this plugin's configuration directory. zipextractor.admin.plugindir
/ze terminate This command will initiate the shutdown proccess for the plugin's execution servicer. Any queued tasks at the time of shutdown will be allowed to finish. It is recommended not to shutdown or restart the server until this has finished. zipextractor.admin.terminate
/ze forceterminate This command will forcibly shutdown the plugin's execution servicer and send a request to interrupt and terminate any queued and proccessing tasks. This type of termination is not recommended. zipextractor.admin.forceterminate
/ze reload This command will reload the configuration file. It's necessary to do this after you edit the config file directly. If you use the built-in commands it's automatically reloaded after each edit. zipextractor.admin.reload
/ze version Displays the plugin's version information and provides links to the source code and metrics page. -

Additional Command Information

/ZipExtractor Extract

  • The source path must point to a supported archive file.
  • The destination path must point to a directory.
  • If the configuration option warn_on_conflics is enabled, a scan will be performed before begining the extraction process. If it's determined that one or more files would be overriden by the extraction, the process will be halted and the user will be given options. In order to view eactly which files would be overriden, the command /ze extract view [page] can be run. To proceed with the extraction anyway, run the command /ze extract -override. Note, in order to override you will need an additional permission, namely zipextractor.admin.override.extract.

/ZipExtractor Compress

  • The source path must point to a file or directory.
  • The destination path must point to a zip file. This zip file will be created once the compression is complete. If the path does not point to a zip file, the .zip extension will be appended destination.
  • If the configuration option warn_on_conflics is enabled, the plugin will check to see if the destination file already exists. If it does, the process will be halted. In order to view the currently set destination file, you can check /ze dest [-absolute]. To proceed with the compression anyway, run the command /ze compress -override. Note, in order to override you will need an additional permission, namely zipextractor.admin.override.compress.

/ZipExtractor src and /ZipExtractor dest

These commands will return the source/destination paths exactly as they are defined in the configuration file. If you have defined a relative path and would like to see the absolute path it resolves to, run the command with the -absolute argument.

Example:

  • Defined path: plugins/ZipExtractor/MyArchive.zip
  • Output from..
    • /ZipExtractor src: plugins/ZipExtractor/MyArchive.zip
    • /ZipExtractor src -absolute (Windows): C:\Users\Name\MyServer\plugins\ZipExtractor\MyArchive.zip

/ZipExtractor setsrc and /ZipExtractor setdest

These commands can accept both relative and absolute paths. The relative path starts at your server directory. Therefore if you define a path as plugins it will resolve to C:\An\Example\Path\To\MyServer\plugins.


#Permissions

Permission Description Default
zipextractor.admin.* Access to all ZipExtractor commands. OP
zipextractor.admin.use Allows usage of /ZipExtractor OP
zipextractor.admin.extract Allows usage of /ZipExtractor extract OP
zipextractor.admin.compress Allows usage of /ZipExtractor compress OP
zipextractor.admin.override.extract If warn_on_conflicts is enabled, allows usage of /ZipExtractor extract -override OP
zipextractor.admin.override.compress If warn_on_conflicts is enabled, allows usage of /ZipExtractor compress -override OP
zipextractor.admin.src Allows usage of /ZipExtractor src OP
zipextractor.admin.dest Allows usage of /ZipExtractor dest OP
zipextractor.admin.setsrc Allows usage of /ZipExtractor setsrc OP
zipextractor.admin.setdest Allows usage of /ZipExtractor setdest OP
zipextractor.harmless.status Allow usage of /ZipExtractor status OP
zipextractor.admin.plugindir Allows usage of /ZipExtractor plugindir OP
zipextractor.admin.terminate Allows usage of /ZipExtractor terminate OP
zipextractor.admin.forceterminate Allows usage of /ZipExtractor forceterminate OP
zipextractor.admin.reload Allows usage of /ZipExtractor reload OP
zipextractor.harmless.notify User will be notified if the plugin broadcasts a message. OP

Permission Tree

zipextractor.admin.*

zipextractor.admin.use

zipextractor.admin.extract

zipextractor.admin.compress

zipextractor.admin.override.extract

zipextractor.admin.override.compress

zipextractor.admin.src

zipextractor.admin.dest

zipextractor.admin.setsrc

zipextractor.admin.setdest

zipextractor.harmless.status

zipextractor.admin.plugindir

zipextractor.admin.terminate

zipextractor.admin.forceterminate

zipextractor.admin.reload

zipextractor.harmless.notify


#Configuration File

#!YAML
#-----------------------------------------------
#            Zip Extractor Config
#-----------------------------------------------

#DO NOT CHANGE THIS VALUE.
#CHANGING IT COULD RESULT IN DATA LOSS.
ConfigVersion: 1.0

#---------------[File Settings]-----------------
# Use '/' for a file separator as shown below.
# If your Operating System uses a different
# character for the file seperator, that will
# automatically be detected by the plugin and
# will be converted on the fly. The '/' is for
# for ease of storage.
#
# Both relative and absolute file paths are supported.
file_settings:

  # Specify the file path of your soruce folder/file.
  source_directory: "plugins/ZipExtractor/MyArchive.zip"

  # Specify the file path of the destination folder/file.
  destination_directory: "C:/MyServer/MyOutputFolder"

#--------------[General Settings]---------------
general_settings:

  # Specify whether or not the plugin should
  # log each file inside the archive to the
  # console during task execution.
  log_files: true

  # Specify whether or not the plugin should
  # warn users when operations will result
  # in files being overrided. There is NO
  # undo button, so keeping this option on
  # is HIGHLY recommended.
  #
  # When this is enabled, the files will be
  # scanned beforehand. If any files have
  # conflicts, the operation will be halted
  # and the user will be warned with further
  # information, including how to ignore the
  # warning and proceed anyway.
  warn_on_conflicts: true

  # Specify whether or not the plugin should wait
  # for outstanding tasks to be completed before 
  # the server shuts down. If false, any outstanding
  # tasks will be interrupted and terminated.
  #
  # It's generally a good idea to not shut down the
  # server while tasks are running or queued.
  wait_on_shutdown: true

  # Specify the maximum number of tasks to be queued
  # at a time. This number must be an integer greater
  # than zero. If this condition is not met, the limit
  # will be set to an absurdley large number (2147483647)
  # that will likely never be reached unless something
  # shady is taking place on your server.
  #
  # **Changing this value while the server is running is
  # not possibile, and it will require a restart to take
  # effect.
  max_queue_size: 3

  # Specify the maximum number of threads to be pooled in
  # the plugin's executor service. This number must be an
  # integer greater than zero, or else it will default to
  # 1. IF YOU DO NOT KNOW WHAT THIS MEANS THEN YOU SHOULD
  # NOT CHANGE THIS VALUE, AS POTENTIAL HARM COULD COME TO
  # YOUR SERVER (this is on the bottom for a reason).
  #
  # For your own safety the core pool size is hard set at 1.
  # If you're an advanced user and you want this value to be
  # configurable, contact the author or manager of this plugin.
  #
  # The recommended value for this is 1 unless you are
  # willing to put your server through some serious work when
  # queues get large. Updating this value to a smaller number
  # than the previous one while the server is running will
  # terminate excess threads once they become idle.
  maximum_thread_pool: 1

#Screenshots

Command List Command List

Setting Source Setting Source

Setting Destination Setting Destination

Begining Extraction Begining Extraction

Extraction with Warning Extraction halted when conflicts are detected

Console Output Console Output

Updated