Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TOREVIEW]Labo-java-IO #10

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CompleteFileTransformer passed
Doriane Kaffo committed Mar 19, 2019
commit 03553515fa015af8024e470f31c1358563511d54
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package ch.heigvd.res.labio.impl.transformers;

import ch.heigvd.res.labio.impl.filters.FileNumberingFilterWriter;
import ch.heigvd.res.labio.impl.filters.UpperCaseFilterWriter;
import java.io.Writer;

/**
@@ -8,24 +10,25 @@
* When an instance of this class is passed to a file system explorer, it will
* generate an output file with 1) uppercase letters and 2) line numbers at the
* beginning of each line.
*
*
* @author Olivier Liechti
*/
public class CompleteFileTransformer extends FileTransformer {

@Override
public Writer decorateWithFilters(Writer writer) {
if (true) {
/* if (true) {
throw new UnsupportedOperationException("The student has not implemented this method yet.");
}
}*/
/*
* If you uncomment the following line (and get rid of th 3 previous lines...), you will restore the decoration
* If you uncomment the following line (and get rid of th 3 previous lines...), you will restore the decoration
* of the writer (connected to the file. You can see that you first decorate the writer with an UpperCaseFilterWriter, which you then
* decorate with a FileNumberingFilterWriter. The resulting writer is used by the abstract class to write the characters read from the
* input files. So, the input is first prefixed with line numbers, then transformed to uppercase, then sent to the output file.f
*/
//writer = new FileNumberingFilterWriter(new UpperCaseFilterWriter(writer));
return writer;

writer = new FileNumberingFilterWriter(new UpperCaseFilterWriter(writer));
return writer;
}

}