Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

2 Días
12 Hrs
19 Min
30 Seg
Curso Avanzado de Java SE

Curso Avanzado de Java SE

Anahí Salgado Díaz de la Vega

Anahí Salgado Díaz de la Vega

Reto

8/40

Reading

Now that you know the tags and their use for documenting, I give you the following challenge that consists of general documentation for the Report library, which we created in the Basic Java SE Course. You can find the project here: https://github.com/anncode1/JavaSEBasico/tree/26.EscribirArchivos

...

Register or login to read the rest of the content.

Contributions 77

Questions 2

Sort by:

Want to see more contributions, questions and answers from the community?

Asi quedo mi libreria documentada

package com.codecasales.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * <h1>Make Report</h1>
 * Clase que se encarga de escribir archivos de texto
 * <br>
 * Escribe documentos de texto a partir de los atributos {@code nameFile}, {@code title}
 * y {@code content}, donde {@code nameFile} es el nombre del archivo, {@code title} es el titulo del mismo 
 * y {@code content} el contenido de este.
 * 
 * @author Francisco Casales (codecasales)
 * @version 1.0
 * @since Enero 2019
 * */

public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	/**
	 * Metodo que obtiene el nombre del archivo a generar
	 * 
	 * @return nameFile es un objeto {@code String} con el nombre del archivo sin extencion.
	 * */
	public String getNameFile() {
		return nameFile;
	}
	/**
	 * Metodo que establece el nombre del archivo sin extencion
	 * 
	 * @param nameFile es un objeto de tipo {@code String} que contiene el nombre del archivo sin extencion.
	 * */
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	/**
	 * Metodo que obtiene el titulo del archivo.
	 * 
	 * @return title es un objeto {@code String} con el titulo del archivo.
	 * */
	public String getTitle() {
		return title;
	}
	/**
	 * Metodo que establece el titulo del archivo sin extencion
	 * 
	 * @param title es un objeto de tipo {@code String} que contiene el titulo del archivo.
	 * */
	public void setTitle(String title) {
		this.title = title;
	}
	/**
	 * Metodo que obtiene el contenido del archivo a generar
	 * 
	 * @return content es un objeto {@code String} con el contenido del archivo sin incluir el titulo.
	 * */
	public String getContent() {
		return content;
	}
	/**
	 * Metodo que establece el contenido del archivo sin extencion
	 * 
	 * @param content es un objeto de tipo {@code String} que tiene el contenido del archivo sin titulo.
	 * */
	public void setContent(String content) {
		this.content = content;
	}
	/**
	 * <h1>Metodo makeReport</h1>
	 * Metodo que se encarga de generar los archivos .txt utilizando los datos establecidos por los setters
	 * <br>
	 * Hace una comprobacion, si {@code nameFile}, {@code title} o {@code content} son nulos no genera el archivo
	 * y le pide al usuario proporcionar los datos necesarios.
	 * */
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
	/**
	 * Metodo que obtiene la extension del archivo a generar
	 * 
	 * @return extension es un objeto {@code String} con la extension del archivo 
	 * sin incluir el nombre del archivo.
	 * */
	public String getExtension() {
		return extension;
	}
	/**
	 * Metodo que establece la extension del archivo
	 * 
	 * @param extension es un objeto de tipo {@code String} que contiene la extension del archivo 
	 * sin incluir el nombre del archivo.
	 * */
	public void setExtension(String extension) {
		this.extension = extension;
	}

}

/**

  • <h1> Repot</h1>
    *Report
    *<p>
    *Esta es la clase genera reportes en la extension deseada,
  • Este tiene como parametros obligotorios los siguientes atributos
  • @param Content {@code String}
  • @param Extension {@code String}
  • @param NameFile {@code String}
    *@param Title {@code String}

*@author david
*@version 1.1
*@since 2020

  • */

public class Report {

/** <b>Report</b>: es una clase publica que permite la generación de un archivo plano (txt), la cual se puede utilizar

  • en cualquier proyecto que requiera por ejemplo, generación de logs o de tramas diversas.
  • @author gilberto.guerrero
  • @version 1.1
  • @since 2020
  • */

/**

  • <h1>Report</h1>
  • Report es una clase que nos permite generar un archivo de reporte con un contenido, nombre y extensión determinado.
  • <p>
  • @author angelica
  • @version 1.1
  • @since 2020
  • */

![](

bien genial

package com.andycode.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * <h1>Report</h1>
 * Librería que permite realizar reportes 
 * 
 * <p>
 * Esta  librería nos permite generar reportes de las Movies, Series junto con sus chapters y libros
 * a  excepción de los magazines que tienen la restricción de no poderse visualizar
 * 
 * @author Andres F.B.S
 * @version 1.1
 * @since 2019
 */
public class Report {
    
    /**
     * <h2> Variables </h2>
     * {@code String nameFile} almacena el nombre del archivo/reporte
     * {@code String title} contiene el titulo que lleve el archivo/reporte
     * {@code String content} almacena el contenido del reporte
     * {@code String extension} contiene la extensión  del reporte 
     */

    private String nameFile;

    private String title;

    private String content;

    private String extension;

    public String getNameFile() {
        return nameFile;
    }

    public void setNameFile(String nameFile) {
        this.nameFile = nameFile;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getExtension() {
        return extension;
    }

    public void setExtension(String extension) {
        this.extension = extension;
    }
    /**
     * <h1>Metodo makeReport</h1>
     * Este método  se encarga de generar reporte de texto plano.
     * A continuación  detallamos sus componentes:
     * {@code if} valida que {@code getNameFile()} {@code getTitle} {@code getContent()} obtenidos no sean nulos
     * 
     * Posteriormente creamos el archivo y para ello hicimos lo siguiente
     * {@code File file = new File(getNameFile() + "." + getExtension())} Creamos un obj file. Recibimos el nombre y extensión  seteados 
     * 
     * {@code FileOutputStream fos = new FileOutputStream(file)} Escribimos los caracteres - Va a preparar el archivo para escribir bytes
     * 
     * {@code OutputStreamWriter osw = new OutputStreamWriter(fos)} Convertir todos los bytes en el archivo - Convertir  el String de los bytes 
       en caracteres
     * 
     * {@code BufferedWriter bw = new BufferedWriter(osw)} Escribimos los elementos de una forma mas eficiente
     * 
     * {@code bw.write(getContent())} Una vez escrito {@code bw.close()Debemos cerrarlo}
     */
    public void makeReport() {

        if ((getNameFile() != null) && (getTitle() != null) && (getContent() != null)) {
            // crear archivo 
            try {
                File file = new File(getNameFile() + "." + getExtension()); //Manipular el archivo en forma de obj

                FileOutputStream fos = new FileOutputStream(file); 

                OutputStreamWriter osw = new OutputStreamWriter(fos);  

                BufferedWriter bw = new BufferedWriter(osw); // Escribir elementos mucho mas rapido 
                bw.write(getContent());
                bw.close(); // Puede ocasionar errores si se deja abierto

            } catch (IOException e) {
                e.printStackTrace();
            }

        } else {
            System.out.println("Ingresa los datos del archivo");
        }

    }

}

Listo, acá lo comparto:

/**
 * <h1>Report</h1>
 * Report es una herramienta que nos ayuda a generar un archivo con los datos
 * que se le brindan y además con la extensión que se le indica
 *
 *
 * @author anncode
 * @version 1.1
 * @since 20018
 */
```0
/**
 *	<h1>Report</h1> 
 *	<p>Esta clase se encarga de la emisión de reportes</p>
 *  @author anncode
 *  @author mgutierrez
 *  @since 2020
 *  @version 1.1.0
 * */

public class Report {```
/**
	 * <h2>makeReport<h2>
	 * <p>
	 * Este metodo consiste en crear un reporte con la información que ha sido seteada en el objeto de tipo Report,
	 * crea un archivo, con las especificaciones dadas y guarda en disco el archivo de reporte generado.
	 * @author anncode
	 * @author mgutierrez
	 * @since 2020
	 * @version 1.1.0
	 * 
	 * */
	public void makeReport() {```

package mx.com.ngkntk.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**

  • <h1>Report</h1>
  • <p>
  • Es una clase que se encarga de generar un reporte creadon un archivo de texto y almacenando
  • la información dentro de él
  • @author j_marron
  • @version 1.1
  • @since 2019

*/
public class Report {

private String nameFile;
private String title;
private String content;
private String extension;

public String getNameFile() {
	return nameFile;
}

public void setNameFile(String nameFile) {
	this.nameFile = nameFile;
}

public String getTitle() {
	return title;
}

public void setTitle(String title) {
	this.title = title;
}

public String getContent() {
	return content;
}

public void setContent(String content) {
	this.content = content;
}

public String getExtension() {
	return extension;
}

public void setExtension(String extension) {
	this.extension = extension;
}

/**
 * <h1>Método makeReport</h>
 * Método que se encarga de generar el archivo de tecto a partir de algunas cadenas que proporcionan
 * el nombre del archivo {@code nameFile}, {@code title} y {@code content} y valida que ninguna sea null.
 * En caso contrato de qu alguna no cumpla con la condición, no genera el archivo.
 */
public void makeReport() {
	if((getNameFile() != null) && (getTitle() != null) && (getContent() != null)) {
		try {
			File file = new File(getNameFile() + "." + getExtension());
			FileOutputStream fos = new FileOutputStream(file);
			OutputStreamWriter osw = new OutputStreamWriter(fos);	
			BufferedWriter bw = new BufferedWriter(osw);
			bw.write(getContent());
			bw.close();
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}

}

¿Cómo puedo publicar mis capturas?

package com.yossi.makereport;
import java.io.*;

/**
 * <h1>Report</h1>
 * <p>
 * La implementación de esta libreria ayuda a generar reportes en texto plano
 * para la mejora de sistemas que realizan acciones
 * 
 * <h2>Variables</h2>
 * {@code String nameFile} almacena el nombre del archivo a generar
 * {@code String title} almacena el titulo que se colocara en archivo de texto
 * {@code String content} almacena el contenido del archivo a generar
 * {@code String extension} guarda la extensión que tendra el tipo de archivo a generar
 * 
 * */

public class Report {

	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public void makeReport() {
		if ((getNameFile() != null) && (getTitle() != null) && (getContent() != null)) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
}```
 /**
 * <h1>Reporte</h1>
 * esta clase es una libreria
 * <p>
 * Nos ayuda a poder generar reportes con  
 * extension<strong>.txt</strong> utilizando
 * el metodo {@code hacerReporte()}
 * @author   Alessandro
 * @version  1.0
 * @since    2018
 * */
/**
 *<h1> Report</h1>
 * La clase report genera un archivo con los parametros enviados al método {@code makeReport}
 *<p>
 * Para la generación del archivo se validan inicialmente los parametros recibidos.
 *<p>
 *@param {@code nameFile} Parametro del nombre del archivo del reporte.
 *@param {@code content} Parametro del contenido del reporte
 *@param {@code title} Parametro del titulo del reporte
 *@param {@code extension} Parametro obligatorio del tipo de archivo a crear
 *@author Jhon Martinez
 *@version 1.0
 *@since 2018
 *
 **/

/**

  • <h1>Report></h1>
  • La clase report nos ayuda a generar reportes a través del método {@code makeReport}
  • @author josueSS
  • @version 1.1
  • @since 2018
  • */
/**
 * <h1>Report</h1>
 * Esta clase permite crear un reporte en formato TXT
 * de las peliculas, series y libros que hemos visto o 
 * leido
 * 
 * @author: Carlos A Lozano A
 * @version:1.0
 * @since: 2019
 * */
public class Report {

	private String nameFile;
	private String tittle;
	private String content;
	private String extension;

![](

Reto completado.
Omití los Getters y Setters ya que estos no tienen modificaciones.

package com.mael.makereport;

import java.io.*;

/**
 * <h1>Make Report</h1>
 * Report permite crear archivos
 * <p>
 *     Permite colocar el nomnbre, contenido y extension deseada para los archivos.
 *     Contiene todos sus métodos Getters y Setters respectivos
 *
 * @author anncode
 * @author mael358
 * @version 1.0
 * @since 2019
 */
public class Report {
    private String nameFile;
    private String title;
    private String content;
    private String extention;
    private String[] hola = new String[20];



    public String getNameFile() {
        return nameFile;
    }

    public void setNameFile(String nameFile) {
        this.nameFile = nameFile;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getExtention() {
        return extention;
    }

    public void setExtention(String extention) {
        this.extention = extention;
    }

    /**
     * Método que nos ayuda a hacer el reporte en sí, se usan las clases
     * de FileOutputStream, OutputStreamWriter, BufferedWriter.
     */
    public void makeReport(){
        if (getTitle() != null &&
            getContent() != null &&
            getNameFile() != null){
            try {
                File file = new File(getNameFile()+"."+getExtention());
                FileOutputStream fos = new FileOutputStream(file);
                OutputStreamWriter osw = new OutputStreamWriter(fos);
                BufferedWriter bw = new BufferedWriter(osw);
                bw.write(getContent());
                bw.close();
            }catch (FileNotFoundException e){
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }else {
            System.out.println("Ingresa los datos del archivo");
        }
    }
}

/**

  • Libreria que permite generar reportes a traves de archivos en cualquier formato

  • utilizando el Método {@code makeReport}

  • @author Johan

  • @since 2018

  • @version 1.1
    */
    publicclass Report {
    privateString nameFile;
    privateString title;
    privateString content;
    privateString extension;

    publicString getNameFile() {
    return nameFile;
    }

    publicString getExtension() {
    return extension;
    }
    }

/**

  • Libreria que permite generar reportes

  • utilizando el Método {@code makeReport}

  • @author Marcos Imfeld

  • @since 2018

  • @version 1.1
    */
    publicclass Report {
    privateString nameFile;
    privateString title;
    privateString content;
    privateString extension;

    publicString getNameFile() {
    return nameFile;
    }

    publicString getExtension() {
    return extension;
    }
    }


/**
 * <h1>Librería Report</h1>
 * Librería que permite generar reportes en cualquier formato utilizando el método {@code makeReport()}
 * <p>
 * Existen algúnas reglas a la hora de generar el reporte, éste debe tener un nombre, título y contenido definido para poder funcionar a la perfección
 * @author Bruno Cal
 * @since 2019
 * @version 1.1
 * */


public class Report {

	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public void makeReport() {
		if(getNameFile() != null && (getTitle() != null) && (getContent() != null)) {
			//Crear file
			try {
				File file = new File(getNameFile()+"." +getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		}else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
}
package com.anncode.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * <p>
 *     Report
 * </p>
 * <p>
 *     Ésta clase genera un reporte de los contenidos vistos en formato txt.
 * </p>
 * <p>
 *     Se utiliza el método {@code makeReport()} para generarlos.
 * </p>
 * @author VHugoBarnes
 * @since 2019
 * @version 1.1
 * */

public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
	
	
	
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}

}

A continuación presento mi libreria documentada:

Clase Main

package com.jaidenmeiden.makereport;

/**
 * <h1>Make Report</h1>
 * Make Report es un programa que permite generar archivos de texto con cualquier contenido.
 * <p>
 * El programa puede ser utilizado en cualquier otro programa para generar evidencias,
 * documentos, reportes, etc.
 * 
 * @author Highlander Sword
 * @version 1.1
 * @since 2019
 * 
 * */
public class Main {
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Report report = new Report();
		report.setNameFile("reporte");
		report.setExtension("txt");
		report.setTitle(":: REPORTE:: \n");
		String content = report.getTitle();
		for (int i = 0; i < 5; i++) {
			content += "\nReporte : " + i;
		}
		report.setContent(content);
		report.makeReport();
		
		System.out.println("Guardo el archivo!");

	}
}

Clase Report

package com.jaidenmeiden.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * <h1>Report</h1>
 * Report es una clase para generar archivos
 * <p>
 * Esta clase se utiliza para generar archivos con contenido personalizado 
 * usando la función {@code makeReport()} que es la que escribe el contenido en 
 * el archivo de texto. Se podría configurar con un formato especifico.
 * 
 * 
 * @author Highlander Sword
 * @version 1.1
 * @since 2018
 * */
public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getNameFile() {
		return nameFile;
	}
	
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	
	public String getTitle() {
		return title;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getContent() {
		return content;
	}
	
	public void setContent(String content) {
		this.content = content;
	}
	
	public String getExtension() {
		return extension;
	}
	
	public void setExtension(String extension) {
		this.extension = extension;
	}
	
	/**
	 * {@code makeReport()} que es la que escribe el contenido en el archivo de texto
	 * */
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());//Se crea el archivo
				FileOutputStream fos = new FileOutputStream(file);//Convierte el archivo a String de bytes
				OutputStreamWriter osw = new OutputStreamWriter(fos);//Convierte todos los bytes en el archivo
				BufferedWriter bw = new BufferedWriter(osw);//Iniciamos el buffer
				bw.write(getContent());//Escribimos el contenido
				bw.close();//Cerramos el buffer
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}

}
package com.anncode.makereport;

import java.io.*;

/**
 * <h1>Report</h1>
 * Genera un reporte.
 * <p>
 *     Genera un reporte con nombre, contenido y titulo, con el metodo {@code makeReport()}
 * </p>
 *
 * @author oguhcode
 * @version  1.1
 * @since 2019
 * */
public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;

	/**
	 * Metodo {@code getNameFile()} obtiene el nombre del archivo.
	 * @return Devuelve el nombre del archivo de tipo {@code String}
	 * */
	public String getNameFile() {
		return nameFile;
	}

	/**
	 * Metodo {@code setNameFile(String nameFile)} asigna el nombre del archivo.
	 *
	 * @param nameFile nombre asignado al archivo.
	 * */
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}

	/**
	 * Metodo {@code getTitle()} obtiene el nombre del titulo.
	 * @return Devuelve el nombre del titulo de tipo {@code String}
	 * */
	public String getTitle() {
		return title;
	}

	/**
	 * Metodo {@code setTitle(String title)} asigna el titulo del archivo.
	 *
	 * @param title titulo asignado al archivo.
	 * */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * Metodo {@code getContent()} obtiene el contenido del archivo.
	 * @return Devuelve el contenido del archivo de tipo {@code String}
	 * */
	public String getContent() {
		return content;
	}

	/**
	 * Metodo {@code setContent(String content)} asigna el contenido del archivo.
	 *
	 * @param content contenido asignado al archivo.
	 * */
	public void setContent(String content) {
		this.content = content;
	}
	
	/**
	 * Metodo {@code nameFile} genera el reporte solicitado.
	 * */
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}


	/**
	 * Metodo {@code getExtension()} obtiene la extensión del archivo.
	 * @return Devuelve la extensión del archivo de tipo {@code String}
	 * */
	public String getExtension() {
		return extension;
	}

	/**
	 * Metodo {@code setExtension(String extension)} asigna la extensión del archivo.
	 *
	 * @param extension extensión asignada al archivo.
	 * */
	public void setExtension(String extension) {
		this.extension = extension;
	}

}










Por supuesto que también se dan los créditos a @anncode

/**
*<h1>Class Report</h1>
*Permite la generacion de reporte en salida txt
*<p>
*Para la generacion hace uso del método {@code makeReport()} para la salida del archivo.
*
*
*@author Jpinto
*@version 1.1
*@since 2019
*/

/**
 * <h1>Make Report</h1>
 * Libreria que se encarga de generar reportes en archivos .txt
 * <p>
 * Se generan reportes en archivos con la extension dada en {@code extension},
 * creando asi un reportes con los siguientes atributos: {@code nameFile} nombre del archivo, 
 * {@code content} contenido, y {@code title} el titulo.
 * 
 * @author Caeld
 * @version 1.0 
 * @since 2021
 * */
public class Report {
	private String nameFile;
	private String content;
	private String title;
	private String extension;

	public String getNameFile() {
		return nameFile;
	}

	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getExtension() {
		return extension;
	}

	public void setExtension(String extension) {
		this.extension = extension;
	}
	
	/**
	 * {@code makeReport()} es un metodo que se encarga de crear el report
	 * */
	public void makeReport() {
		if (getNameFile() != null && getContent() != null && getTitle() != null) {
			// Crear archivo
			
			
			try {
				
				File file = new File(getNameFile() + "." + getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {

				e.printStackTrace();
				System.out.println(e.getMessage());
			}
			
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}

}
/**
 * <h1>Report</h1>
 * Esta es una libreria encargada de generar el reporte de 
 * las actividades realizadas en AmazonViewer.
 * <p>
 * Para tal fin utiliza el metodo {@code makeReport()} 
 * que genera un archivo .txt con dicho reporte
 * <p>
 * @param {@code nameFile} Parametro del nombre del archivo del reporte.
 * @param {@code content} Parametro del contenido del reporte
 * @param {@code title} Parametro del titulo del reporte
 * @param {@code extension} Parametro obligatorio del tipo de archivo a crear
 * <p>
 * @author Cristian Perez
 * @version 1
 * @since 2018
 * 
 * */

/**
 * Libreria que permite generar reportes a travez de archivos de cualquier extension, esto a travez
 * del metodo @{code makeReport()}
 *
 * @author fronzec
 * @since 2018
 * @version 1.0.0
 */
public class Report {
  private String nameFile;
  private String title;
  private String content;
  private String extension;

  public String getNameFile() {
    return nameFile;
  }

  public void setNameFile(String nameFile) {
    this.nameFile = nameFile;
  }

  public String getTitle() {
    return title;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }

  public String getExtension() {
    return extension;
  }

  public void setExtension(String extension) {
    this.extension = extension;
  }
}

¿Comó se puede mostrar capturas de pantalla en los comentarios?

Use la siguiente documentación:

/**

  • <h1>Report</>
  • Esta clase permite generar reportes de forma general o sobre una fecha específica.
  • <p>
  • Los documentos generados se guardan en formato txt.
  • <p>
  • Se usa el método {@code makeReport()} para la generación de archivos que se guardan en el disco local.
  • @author YMONTENEGRO
  • @version 1.1
  • @since 2019
  • */
/**
 * <h1>Librería Report</h1>
 * Report es una librería que te permite generar reportes en cualquier formato
 * <p>
 * Existen algunas reglas a la hora de generar un reporte tiene que tener un nombre, titulo y un contenido
 * 
 * @author njmunoz
 * @version 1.1
 * @since 2019
 * */
/**
* Método que crea un un archivo de tipo {@code File}
* */
<code>
package com.sacode.makereport;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.Buffer;


/**
 * Libreria que permite generar reportes en archivos de text plano .txt
 * utilizando el Método {@code makeReport}
 * @author Santiago
 * @since 2019
 * @version 1.1
 */

public class Report {

	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
<code>
package com.sacode.makereport;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.Buffer;


/**
 * Libreria que permite generar reportes en archivos de text plano .txt
 * Utiliza el Método {@code makeReport} que permite crear el reporte 
 * @author Santiago
 * @since 2019
 * @version 1.1
 */

public class Report {

	private String nameFile;
	private String title;
	private String content;
	private String extension;
	

A continuación mi implementación de la librería makefile documentada:

Código:

/**
 * <h1>Report</h1>
 * <p>
 * Esta clase permite generar reportes en formato .txt de información de interés como lo puede ser: cantidad de series, películas
 * ya vistas con su información detallada.
 * {@code makeReport()} este método es el que tiene implementado la función de hacer los reportes
 * 
 * @author moisescode
 * @version 1.0
 * @since 2019
 *
 */
public class Report {
	
		private String nameFile;
		private String title;
		private String content;
		private String extension;
				
				
					public String getNameFile() {
						return nameFile;
					}
					public void setNameFile(String nameFile) {
						this.nameFile = nameFile;
					}
					public String getTitle() {
						return title;
					}
					public void setTitle(String title) {
						this.title = title;
					}
					public String getContent() {
						return content;
					}
					public void setContent(String content) {
						this.content = content;
					}
					
					public String getExtension() {
						return extension;
					}
					public void setExtension(String extension) {
						this.extension = extension;
					}
				
				/**
					* {@code makeReport()} Este método genera los reportes siempre y cuando el objto File reciba la siguiente información:
					* -Nombre del archivo
					* -Titulo
					* -Contenido
					*/
				
					
			public void makeReport() {
				if ((getNameFile() != null) && (getTitle() != null) && (getContent() != null)) {
						
					try {
						File file = new File(getNameFile() + "." + getExtension());
						FileOutputStream fos = new FileOutputStream(file);
						OutputStreamWriter osw = new OutputStreamWriter(fos);
						BufferedWriter bw = new BufferedWriter(osw);
						bw.write(getContent());
						bw.close();
					} catch (IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}
				
				} else {
						System.out.println("Ingresa los datos del archivo");
					}
				}
				
}

En JavaDocs, lo generé siguiendo el tutorial de uno de nuestros compañeros de la comunidad ( https://platzi.com/tutoriales/1236-java-avanzado/2333-generar-y-anadir-javadoc/) :


/**
*
*	
*	<h1>Librería encargada de crear archivos txt.</h1>
*
*	<p> Mediante la escritura de archivos<p/>
*
*
*	
*
*
*	
*
*/
public class Report {
    privateString nameFile;
    privateString title;
    privateString content;
    privateString extension;

    publicString getNameFile() {
        return nameFile;
    }

    publicString getExtension() {
        return extension;
    }
}


/**
 * <h1> Report </h1>
 * Permite generar reportes de lo registrado en Amazon Viewer y almancenarlo en un archivo de texto 
 * <p>
 * Esta clase permite llamar al metodo {@code makereport()} que genera el reporte de las Movies, series,chapters y books
 * visualizados almacenandolos en un archivo de texto plano (.txt)
 * 
 * @author Jordy Portuguez
 * @version 1.1
 * @since 2019
 *
 */
package com.anncode.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**

 * <h1> Libreria para Generar Reportes en archivo</h1>
 * 
 * <p>
 * Escribe un archivo de texto a partir de los atributos {@code nameFile} nombre de archivo, {@code title} titulo
 * y {@code content} contenido.
 *  
 * @author laguz81
 * @version 1.1
 * @since 2019
 *
 */
public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
	
	
	
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}

}











package como.lsc.makereport;

/**
 * <h1>Report</h1>
 * 
 * <p>
 * Tiene como objetivo generar un archivo de slaida, se recibe como párametro 
 * nombre del archivo, contenido, titulo y la extensión
 * </p>
 * 
 * @author Laura Córdoba
 * @version 1
 * @since 2019
 **/



import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.Buffer;

public class Report {

	private String nameFile;
	private String content;
	private String title;
	private String extention;

	public String getNameFile() {
		return nameFile;
	}

	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getExtention() {
		return extention;
	}

	public void setExtention(String extention) {
		this.extention = extention;
	}

	public void makeReport() {
		if (getNameFile() != null && getTitle() != null && getContent() != null) {

			try {

				File file = new File(getNameFile() + "." + getExtention());
				// empezar a leer los caracteres
				FileOutputStream fos = new FileOutputStream(file);
				// convertir todos los bytes en el archivo en caracteres
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter br = new BufferedWriter(osw);
				br.write(getContent());
				br.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		} else {
			System.out.println("Ingresa los datos del archivo");
		}

	}

}

/**

  • <h1>Report</h1>
  • Report es una lireríaque permite realizar el reporte, para este caso de Amazon Viewer
  • <p>
  • Esta libreria genera un archivo de salida con la estención deseada {@code setExtension(String extension)}
  • con el nombre deseado {@code setNameFile(Sting nameFile)} haciendo uso del método {@code makeReport()}.
  • @author Sophos Solutions
  • @version 1.0
  • @since 2019
    */
package com.anncode.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
* <h1>Report</h1>
* Es una clase que permite generar un archivo
* </br>
* <p>
* Es una clase para generar archivos de cualquier tipo
* @author Rolando
* @version 1.1
* @since 2020-02-27
*/
public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
  	/**
    * {@code makeReport()} es método que permite craer un archivo
    * 
    */
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
	
	
	
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}

}

Listo 😃

/**
*<h1>Report</h1>
* esta una librería 
*<p>
* Nos ayuda a poder generar reportes con  
* extension<strong>.txt</strong> utilizando
* el metodo {@code makeReport()}
*@author   sroba
*@version  1.0
*@since    2018
* */

/**

  • <h1>Report</h1>
  • Clase encargada de generar un reporte de datos.
  • <p>
  • Esta clase a través del metodo {@code makeReport()}} creara el archivo de nombre,
  • extension y contenido pasados por el usuario.
  • @author kristo
  • @version 1.1
  • @since 2018
  • */
/**
<h1> Reporte </h1>
	 * 
	 * Genera un reporte de todo lo que se vio 
	 * <p>
	 * genera los reportes en formato "txt".
	 * */
	public static void makeReport(){}

         /**
	 * <h1> Reporte del Día</h1>
	 * 
	 * Genera el reporte del dia con la fecha.
	 * 
	 * */
	public static void makeReport(Date date) {}

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
*<h1>Make Report</h1>

  • Clase que se encarga de generar archivos de texto mediante datos de vistas
    *<br>
  • Crear el txt con base a {@code nameFile}, {@code title}
  • {@code content} es el contenido del archivo.
  • <br>
    *@author anncode
    *@version 1.0
    *@since Febero 2019 jdk 11
    **/

public class Report {

private String nameFile;
private String title;
private String content;
private String extension;
<code>
package com.marvel.makereport;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
/** Librería para generar un reporte por medio  del metodo makeReport()	
 * @author Marvel
 * @version 1.0
 * @since 2019
 */
public class Report {

		private String nameFile;
		private String title;
		private String content;
		private String extension;
		
/**Método para obtener la extención del archivo
 */
		public String getExtension() {
			return extension;
		}
/**Método para establecer el nombre de la extención 
  */
		public void setExtension(String extension) {
			this.extension = extension;
package com.kevincode.makereport;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;


/**
 * <h1>Reports</h1>
 * Esta clase genera reportes de archivos.
 * Se utiliza el metodo {@code makeReport()}
 * @author steve
 * @since 2019
 * @version 1.1
 * */
public class Report {

	private String nameFile;
	private String Title;
	private String Content;
	private String extension;
	


	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return Title;
	}
	public void setTitle(String title) {
		Title = title;
	}
	public String getContent() {
		return Content;
	}

Métodos comentados:

package com.tom.makereport;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;


/**
 * @author Tomas Lopez
 * Libreria para generar reportes mediante el metodo makeReport usando librerias estandar de java.io {@code BufferedReader}}
 * @since 02/02/2019
 * @version 1.0.0
 * */
public class Report {
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}
	
	
	/**
	 * @author Tomas López
	 * Metodo que genera el reporte y lo convierte en un archivo dependiendo de lo que se configure en sus atributos en esta clase.
	 *@since 02/02/2019
	 * */
	public void makeReport(){
		if((getNameFile()!=null) && (getTitle()!=null) && (getContent()!=null)) {
			//Crear el archivo
			try {
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();						
			} catch (IOException e) {
				e.printStackTrace();
			}			
		}else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
}

/**

  • <h1>Make Report</h1>
  • Clase que se encarga de escribir reportes, en el tipo de archivo seleccionado.
  • utilizando el Método {@code makeReport}
  • @author TeddySipra
  • @since 2019
  • @version 1.1
    */
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * <h1>Libreria Reportes</h1>
 * <p>
 * Permite generar un archivo de texto con la información ingresada, haciendo uso del metodo 
 * {@code makeReport()}
 * @author Ximena
 * @since 2019
 * @version 1.1
 *
 */
public class Report {
	private String nameFile;
	private String tittle;
	private String content;
	private String extension;
	
	public String getExtension() {
/**
 * <h1>Report</h1>
 * Report es una libreria para generar reportes
 * <p>
 * Esta libreria genera un archivo de salida del tipo indicado en su método {@code setExtension(String extension)}}
 * con el nombre indicado en su método {@code setNameFile(String nameFile)} utilizando para ello el método {@code makeReport()}.
 * 
 * @author anncode
 * @version 1
 * @since 2018
 *
 */

/**

  • <h2>Class Report</h2>
  • clase Report
  • <p>
  • Generacion dereportes
  • @author ivancode
  • @since 2019
  • @version 1.1

/
/
*

  • <h2>Main</h2>
  • main
  • <p>
  • clase principal
  • @author ivancode
  • @since 2019
  • @version 1.1
    */
package com.anncode.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * <h1>Report</h1>
 * Permite generar y almacenar los datos relacionados a un reporte. 
 * <p>
 * Incluye el nombre 
 * y extensión del archivo, el título del reporte y el contenido del mismo.
 * 
 * @author Gustavo
 * @version 1.0
 * @since 2019
 */
public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	/**
         * Permite extraer el nombre del archivo.
         * @return El nombre del archivo en formato {@code String}.
         */
	public String getNameFile() {
		return nameFile;
	}
        /**
         * Permite establecer cual será el nombre del archivo.
         * @param nameFile El nombre que se desea asignar al archivo.
         */
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
        /**
         * Obtiene el título del reporte.
         * @return El título del reporte en formato {@code String}.
         */
	public String getTitle() {
		return title;
	}
        /**
         * Permite establecer el título del reporte.
         * @param title Título que se desea asignar al reporte.
         */
	public void setTitle(String title) {
		this.title = title;
	}
        /**
         * Obtiene el contenido del documento.
         * @return El contenido del reporte en formato {@code String}.
         */
	public String getContent() {
		return content;
	}
        /**
         * Permite almacenar el contenido del reporte.
         * @param content Texto que se desea guardar.
         */
	public void setContent(String content) {
		this.content = content;
	}
	/**
         * <h1>MakeReport</h1>
         * Crea un reporte con los parámetros establecidos.
         * <p>
         * Crea un archivo de texto con el nombre y la extensión deseada.
         * El cotenido de este será el mismo que se ingresó mediante los 
         * métodos {@code setTitle()} y {@code setContent()}. 
         */
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
	
	/**
         * Obtiene la extensión del archivo de texto.
         * @return La extensión del archivo de texto.
         */
	public String getExtension() {
		return extension;
	}
        /**
         * Establece la extensión del archivo de texto
         * @param extension La extensión deseada.
         */
	public void setExtension(String extension) {
		this.extension = extension;
	}

}```

Excelente reto!!!

package com.anncode.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * <h1>MakeaReport</h1>
 * en esta clase se crea el reporte  para Movies, Books, magazines  con sus
 * capitulos que han sido vistos por los diferentes usuarios.
 * <p>
 * @author anncode
 * @version 1.1
 * @since 06/12/2019
 * 
 * */


public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
	
	
	
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}

}

No vi el curso anterior, pero viendo la solución de los comentarios pude deducir y hacer mi solución.

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/*
*<h1> Report </h1>
* Report es una clase que permite guardar los archivos de los reportes generados
* por el metodo {@code makeReport}
* <p>
* Estos archivos txt guardan  los reportes de los capitulos,series, film  y libros
* visualizados donde deben tener un nombre, titulo y contenido dado.
*
* @author omaralban
* @version 1
* @since 2020.0
*/
public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}
	
	
	
	public String getExtension() {
		return extension;
	}
	public void setExtension(String extension) {
		this.extension = extension;
	}

}



Genial.

/**
*
*<h1> Documentación del método makeReport<h1>
*<p>
* Ahí se graba la información en un archivo para generar el reporte.
*
*@author rps
*@since 2020
*@version 1.0
*
*
**/
public void makeReport() {
if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {

Reto:

/**
 * <h1> Report </h1>
 * <p>
 * Clase que permite la emision de reportes en formato .xlsx, .text, etc, 
 * de cierta información que ha sido seteada en el objeto report. </p>
 *
 * @author deyvisnvg
 * @version 1.1
 * @since 2020
 *
 */

public class Report {…

/**
 * <h1>Make Report App</h1>
 * <p>Make Report nos permite crear archivos con<br>
 * 	  distintas extenciones y agregar contenido a estos archivos
 *  </p>
 * */

/**
 * <h1>Clase Reporte</h1>
 * Crea reportes de textos y lo agrega a un archivo bajo las siguientes propiedades:
 * <p>
 * {@code nameFile}: nombre del archivo donde se guardará el reporte; 
 * {@code title}: titulo del reporte; 
 * {@code content}: contenido que se va a agregar al archivo; 
 * {@code extension}: tipo del archivo; 
 * {@code makeReport()}: Valida si las propiedades tienen datos para escribir el contenido al archivo
 * <p>
 * @author Alejandro Pulido
 * @version 1.0
 * @since March 2023
 * */

public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;
	
	public String getNameFile() {
		return nameFile;
	}
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}
	public String getTitle() {
		return title;
etc...
```java package com.anncode.makereport; import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; public class Report { private String nameFile; private String title; private String content; private String extension; /** *

Report

* Librería que permite realizar reportes * *

* Esta librería nos permite generar reportes de las Movies, Series junto con sus chapters y libros * a excepción de los magazines que tienen la restricción de no poderse visualizar * * @author Juan Carlos Reynoso Zuñiga * @version 1.1.0 * @since 2024 */ public String getNameFile() { return nameFile; } public void setNameFile(String nameFile) { this.nameFile = nameFile; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public void makeReport() { if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) { //Crear el archivo try { File file = new File(getNameFile()+"."+getExtension()); FileOutputStream fos = new FileOutputStream(file); OutputStreamWriter osw = new OutputStreamWriter(fos); BufferedWriter bw = new BufferedWriter(osw); bw.write(getContent()); bw.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { System.out.println("Ingresa los datos del archivo"); } } public String getExtension() { return extension; } public void setExtension(String extension) { this.extension = extension; } } ```

package com.anncode.makereport;

/**
 *
 * <h1>MakeReport</h1>
 * Clase principal del programa MakeReport.
 * MakeReport es una biblioteca que te permite escribir archivos.
 * <p>
 * Esta clase muestra un ejemplo de uso de la biblioteca MakeReport para escribir un archivo.
 *
 * @author Facu
 * @version 1.1
 * @since 2023
 *
 */
public class Main {

	/**
	 * Método principal que demuestra el uso de la biblioteca MakeReport para escribir un archivo.
	 * Crea un objeto Report, configura sus atributos y se escribe el archivo.
	 *
	 * @param args Los argumentos de línea de comandos. No se utilizan en este ejemplo.
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Report report = new Report();
		report.setNameFile("reporte");
		report.setExtension("txt");
		report.setTitle(":: REPORTE:: \n");
		String content = report.getTitle();
		for (int i = 0; i < 5; i++) {
			content += "\nReporte : " + i;
		}
		report.setContent(content);
		report.makeReport();

	}

}
------------------------------------------------------------------------------------
package com.anncode.makereport;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 *
 * <h1>Report</h1>
 * Report es una clase que representa los archivos a escribir.
 * <p>
 * Report contiene el método {@code makeReport()} que se encargará de escribir un archivo.
 * <br/>
 * Las propiedades de un objeto producto de una instancia de la clase Report son: {@code nameFile}, {@code title},
 * {@code content}, y {@code extension}. Cada propiedad tiene sus respectivos métodos getter y setter.
 *
 * @author Facu
 * @version 1.1
 * @since 2023
 *
 */
public class Report {
	
	private String nameFile;
	private String title;
	private String content;
	private String extension;

	/**
	 * Devolver el nombre del archivo.
	 * @return El nombre del archivo.
	 */
	public String getNameFile() {
		return nameFile;
	}

	/**
	 * Setear el nombre del archivo.
	 * @param nameFile
	 */
	public void setNameFile(String nameFile) {
		this.nameFile = nameFile;
	}

	/**
	 * Devolver el título del archivo
	 * @return El título del archivo.
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * Setear el título del archivo.
	 * @param title
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * Devolver el contenido del archivo
	 * @return El contenido del archivo.
	 */
	public String getContent() {
		return content;
	}

	/**
	 * Setear el contenido del archivo.
	 * @param content
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * Crear un archivo a partir de los siguientes atributos:
	 * <ul>
	 *     <li>{@code nameFile}</li>
	 *     <li>{@code title}</li>
	 *     <li>{@code content}</li>
	 *     <li>{@code extension}</li>
	 * </ul>
	 *
	 * @return El método no devuelve un valor ya que su output es el archivo ya escrito.
	 * @throws IOException Si hay un problema en la escritura del archivo.
	 */
	public void makeReport() {
		if ( (getNameFile() != null) && (getTitle() != null) && (getContent() != null) ) {
			//Crear el archivo
			try {
				
				File file = new File(getNameFile()+"."+getExtension());
				FileOutputStream fos = new FileOutputStream(file);
				OutputStreamWriter osw = new OutputStreamWriter(fos);
				BufferedWriter bw = new BufferedWriter(osw);
				bw.write(getContent());
				bw.close();
				
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			 
		} else {
			System.out.println("Ingresa los datos del archivo");
		}
	}


	/**
	 * Devolver la extensión del archivo
	 * @return La extensión del archivo.
	 */
	public String getExtension() {
		return extension;
	}

	/**
	 * Setear la extensión del archivo.
	 * @param extension
	 */
	public void setExtension(String extension) {
		this.extension = extension;
	}

}

/**
*
*<h1> Documentación del método makeReport<h1>
*<p>

  • .Se crean archivos de Reporte.

*@author kr
*@since 2021
*@version 1.1
*
*
**/

/**
*<h1>Make Report Aplication</h1>
*<p>

  • Make Report nos permite crear archivos con <br>
  • distintas extensiones .xlsx, .text, etc y agregar contenido a estos archivos.
  • <p>
  • @author frank.vleas
  • @version 1.1
  • @since 2020
    */
/**
 * <h1>Report Library</h1>
 * <p>
 * Es una librería que nos permite generar reportes en formato xlsx y otros.
 * <p>
 * @author anncode
 * @version 1.1
 * @since 2021
 */