-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from josfranmc/dev
Puesta en producción de la versión 2.0
- Loading branch information
Showing
131 changed files
with
13,675 additions
and
18,622 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Copyright (C) 2018-2019 Jose Francisco Mena Ceca <josfranmc@gmail.com> | ||
|
||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
|
||
JGutenbergDownload is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
|
||
You should have received a copy of the GNU General Public License | ||
along with JGutenbergDownload. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
This product includes software developed at | ||
The Apache Software Foundation (http://www.apache.org/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,101 @@ | ||
# JGutenbergDownload | ||
Descarga de ficheros desde los repositorios del proyecto Gutenberg. | ||
|
||
## Contenido | ||
+ jar-flat: fichero jar con las clases de la aplicación junto a las dependencias necesarias, que se ubican en la carpeta lib | ||
+ jar-shaded: fichero jar con las clases de la aplicación y con las dependencias necesarias incluidas en él | ||
+ javadoc: documentación del código | ||
+ src: Código fuente | ||
|
||
## Uso | ||
Desde línea de comandos: | ||
|
||
java -jar JGutenbergDownload-1.0-shaded.jar [*opciones*] | ||
|
||
opciones: | ||
|
||
-t tipo fichero (por defecto txt) | ||
-i idioma (por defecto en) | ||
-d tiempo de espera en milisegundos (por defecto 2000) | ||
-s ruta donde guardar las descargas | ||
-m total_ficheros_a_descargar (por defecto 10, el valor 0 descarga todo) | ||
-z descomprimir (true/false, por defecto true) | ||
-o sobreescribir existentes (true/false, por defecto false) | ||
-x modo de descarga (SOFT/GREEDY, por defecto SOFT) | ||
|
||
-h muestra lista de opciones | ||
|
||
## Notas | ||
Si se usa el jar flat hay que asegurarse que exista la carpeta lib dentro de la carpeta desde la que ejecutemos la aplicación. | ||
|
||
El fichero de log generado se guarda en la carpeta log. | ||
# JGutenbergDownload | ||
This software allows you to download books from the Gutenberg project repositories. | ||
|
||
The Gutenberg project website is intended for human users only. If you want to download many books using an automated tool like this, keep in mind that your ip address can be blocked temporarily or permanently. | ||
The Gutenberg project is a solidarity project based on the hard work of thousands of volunteers. So please, don't abuse. | ||
|
||
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) | ||
|
||
## Getting Started | ||
|
||
The project is a Maven project, so you can import it in your favorite IDE as any other Maven project. | ||
|
||
~~~ | ||
mvn install | ||
~~~ | ||
|
||
will install the artifact in your local repository, being ready to be used as a dependency in any project: | ||
|
||
~~~ | ||
<dependency> | ||
<groupId>org.josfranmc.gutenberg</groupId> | ||
<artifactId>JGutenbergDownload</artifactId> | ||
<version>2.0</version> | ||
</dependency> | ||
~~~ | ||
|
||
When you build the project with Maven you get two jars in the target directory: _JGutenbergDownload-2.0.jar_ and _JGutenbergDownload-2.0-shaded.jar_. The first one is the standard jar of the project. The second one is an _uber_ jar with all necessary dependencies, which is suitable to use from command line. | ||
|
||
Download the latest _uber_ jar from [Releases](https://github.com/josfranmc/JGutenbergDownload/releases). | ||
|
||
## Usage | ||
|
||
The main class to use is `JGutenbergDownload`, which offers some methods to set up the download process. | ||
|
||
The following code will download 20 english books in a folder called _mybooks_: | ||
|
||
~~~ | ||
try { | ||
JGutenbergDownload jg = new JGutenbergDownload(); | ||
jg.setLanguage("en"); | ||
jg.setSavePath("mybooks"); | ||
jg.setMaxFilesToDownload(20); | ||
jg.downloadBooks(); | ||
} catch(GutenbergException e) { | ||
System.err.println(e.getMessage()); | ||
} | ||
~~~ | ||
|
||
You can also use the `DownloadParams` class to set up: | ||
|
||
~~~ | ||
try { | ||
DownloadParams params = new DownloadParams(); | ||
params.setLanguage("en"); | ||
params.setSavePath("mybooks"); | ||
params.setMaxFilesToDownload(20); | ||
JGutenbergDownload jg = new JGutenbergDownload(); | ||
jg.setParameters(params); | ||
jg.downloadBooks(); | ||
} catch(GutenbergException e) { | ||
System.err.println(e.getMessage()); | ||
} | ||
~~~ | ||
|
||
Finally, you can execute the `JGutenbergDownload`'s main method by passing the setting options as argument. The following code perfoms the same function as the previous ones: | ||
|
||
~~~ | ||
try { | ||
String[] args = {"-l", "en", "-s", "mybooks", "-m", "20" }; | ||
JGutenbergDownload.main(args); | ||
} catch(GutenbergException e) { | ||
System.err.println(e.getMessage()); | ||
} | ||
~~~ | ||
|
||
These are the options you can use as arguments: | ||
|
||
~~~ | ||
-f xxx (xxx type of files to download, default: txt) | ||
-l xx (xx language of books to download, default: es) | ||
-s xxx (xxx download path on local machine, default: program folder) | ||
-d xxx (xxx delay between downloads in milliseconds, default 2000) | ||
-m xx (xx max number of downloads (default 10, 0 for dowload all) | ||
-o ( overwrite existing files, default: false) | ||
-z ( don't unzip downloads, default: true) | ||
(only -h to show options list)"); | ||
~~~ | ||
|
||
--- | ||
|
||
It is possible to run the program from the command line. To this purpose, you may use the _JGutenbergDownload-2.0-shaded.jar_ package with any of the options above: | ||
|
||
~~~ | ||
java -jar JGutenbergDownload-2.0-shaded.jar -l en -s mybooks -m 20 | ||
~~~ | ||
|
||
## License | ||
|
||
[GPLv3](https://www.gnu.org/licenses/gpl-3.0) or later, see | ||
[LICENSE](LICENSE) for more details. |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,30 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<!-- NewPage --> | ||
<html lang="es"> | ||
<head> | ||
<!-- Generated by javadoc (1.8.0_102) on Tue Sep 11 12:42:13 CEST 2018 --> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>All Classes</title> | ||
<meta name="date" content="2018-09-11"> | ||
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> | ||
<script type="text/javascript" src="script.js"></script> | ||
</head> | ||
<body> | ||
<h1 class="bar">All Classes</h1> | ||
<div class="indexContainer"> | ||
<ul> | ||
<li><a href="org/josfranmc/gutenberg/download/AbstractDownload.html" title="class in org.josfranmc.gutenberg.download">AbstractDownload</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/DownloadEngineFactory.html" title="class in org.josfranmc.gutenberg.download.engine">DownloadEngineFactory</a></li> | ||
<li><a href="org/josfranmc/gutenberg/engine/DownloadEngineFactoryTest.html" title="class in org.josfranmc.gutenberg.engine">DownloadEngineFactoryTest</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/DownloadEngineType.html" title="enum in org.josfranmc.gutenberg.download.engine">DownloadEngineType</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/DownloadFactory.html" title="class in org.josfranmc.gutenberg.download">DownloadFactory</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/DownloadGreedy.html" title="class in org.josfranmc.gutenberg.download">DownloadGreedy</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/DownloadHttpUrlConnection.html" title="class in org.josfranmc.gutenberg.download.engine">DownloadHttpUrlConnection</a></li> | ||
<li><a href="org/josfranmc/gutenberg/engine/DownloadHttpUrlConnectionTest.html" title="class in org.josfranmc.gutenberg.engine">DownloadHttpUrlConnectionTest</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/DownloadMode.html" title="enum in org.josfranmc.gutenberg.download">DownloadMode</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/DownloadParams.html" title="class in org.josfranmc.gutenberg.download">DownloadParams</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/DownloadResult.html" title="class in org.josfranmc.gutenberg.download.engine">DownloadResult</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/DownloadSoft.html" title="class in org.josfranmc.gutenberg.download">DownloadSoft</a></li> | ||
<li><a href="org/josfranmc/gutenberg/util/FileManager.html" title="class in org.josfranmc.gutenberg.util">FileManager</a></li> | ||
<li><a href="org/josfranmc/gutenberg/util/FileManagerTest.html" title="class in org.josfranmc.gutenberg.util">FileManagerTest</a></li> | ||
<li><a href="org/josfranmc/gutenberg/util/FileScraping.html" title="class in org.josfranmc.gutenberg.util">FileScraping</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/IDownloadEngine.html" title="interface in org.josfranmc.gutenberg.download.engine"><span class="interfaceName">IDownloadEngine</span></a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/IGutenbergDownload.html" title="interface in org.josfranmc.gutenberg.download"><span class="interfaceName">IGutenbergDownload</span></a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/JGutenbergDownload.html" title="class in org.josfranmc.gutenberg.download">JGutenbergDownload</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/client/JGutenbergDownloadClient.html" title="class in org.josfranmc.gutenberg.download.client">JGutenbergDownloadClient</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/JGutenbergDownloadFactory.html" title="class in org.josfranmc.gutenberg.download">JGutenbergDownloadFactory</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/JGutenbergDownloadTest.html" title="class in org.josfranmc.gutenberg.download">JGutenbergDownloadTest</a></li> | ||
</ul> | ||
</div> | ||
</body> | ||
</html> | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<!-- NewPage --> | ||
<html lang="es"> | ||
<head> | ||
<!-- Generated by javadoc (1.8.0_65) on Wed Nov 20 21:31:34 CET 2019 --> | ||
<title>All Classes</title> | ||
<meta name="date" content="2019-11-20"> | ||
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style"> | ||
<script type="text/javascript" src="script.js"></script> | ||
</head> | ||
<body> | ||
<h1 class="bar">All Classes</h1> | ||
<div class="indexContainer"> | ||
<ul> | ||
<li><a href="org/josfranmc/gutenberg/download/DownloadBooks.html" title="class in org.josfranmc.gutenberg.download">DownloadBooks</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/DownloadEngineFactory.html" title="class in org.josfranmc.gutenberg.download.engine">DownloadEngineFactory</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/DownloadEngineType.html" title="enum in org.josfranmc.gutenberg.download.engine">DownloadEngineType</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/DownloadHttpUrlConnection.html" title="class in org.josfranmc.gutenberg.download.engine">DownloadHttpUrlConnection</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/DownloadParams.html" title="class in org.josfranmc.gutenberg.download">DownloadParams</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/DownloadResult.html" title="class in org.josfranmc.gutenberg.download.engine">DownloadResult</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/DownloadThread.html" title="class in org.josfranmc.gutenberg.download">DownloadThread</a></li> | ||
<li><a href="org/josfranmc/gutenberg/util/FileManager.html" title="class in org.josfranmc.gutenberg.util">FileManager</a></li> | ||
<li><a href="org/josfranmc/gutenberg/util/FileScraping.html" title="class in org.josfranmc.gutenberg.util">FileScraping</a></li> | ||
<li><a href="org/josfranmc/gutenberg/util/GutenbergException.html" title="class in org.josfranmc.gutenberg.util">GutenbergException</a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/engine/IDownloadEngine.html" title="interface in org.josfranmc.gutenberg.download.engine"><span class="interfaceName">IDownloadEngine</span></a></li> | ||
<li><a href="org/josfranmc/gutenberg/download/JGutenbergDownload.html" title="class in org.josfranmc.gutenberg.download">JGutenbergDownload</a></li> | ||
</ul> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.