forked from objectionary/eo
-
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.
objectionary#2863 try to get rid of default methods in Home interface
- Loading branch information
Showing
6 changed files
with
278 additions
and
130 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
eo-maven-plugin/src/main/java/org/eolang/maven/util/BiIoProc.java
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,10 @@ | ||
package org.eolang.maven.util; | ||
|
||
import org.cactoos.BiProc; | ||
|
||
import java.io.IOException; | ||
|
||
interface BiIoProc<T, U> extends BiProc<T, U> { | ||
@Override | ||
void exec(T t, U u) throws IOException; | ||
} |
91 changes: 0 additions & 91 deletions
91
eo-maven-plugin/src/main/java/org/eolang/maven/util/DataSaved.java
This file was deleted.
Oops, something went wrong.
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
63 changes: 63 additions & 0 deletions
63
eo-maven-plugin/src/main/java/org/eolang/maven/util/HmNew.java
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,63 @@ | ||
package org.eolang.maven.util; | ||
|
||
import org.cactoos.Bytes; | ||
import org.cactoos.Input; | ||
import org.cactoos.Text; | ||
import org.cactoos.io.InputOf; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.nio.file.Path; | ||
|
||
public class HmNew implements Home { | ||
private final BiIoProc<Input, Path> sve; | ||
|
||
HmNew(BiIoProc<Input, Path> save) { | ||
this.sve = save; | ||
} | ||
|
||
@Override | ||
public void save(String str, Path path) throws IOException { | ||
this.save(new InputOf(str), path); | ||
} | ||
|
||
@Override | ||
public void save(Text txt, Path path) throws IOException { | ||
this.save(new InputOf(txt), path); | ||
} | ||
|
||
@Override | ||
public void save(InputStream stream, Path path) throws IOException { | ||
this.save(new InputOf(stream), path); | ||
} | ||
|
||
@Override | ||
public void save(byte[] bytes, Path path) throws IOException { | ||
this.save(new InputOf(bytes), path); | ||
} | ||
|
||
@Override | ||
public void save(Input input, Path path) throws IOException { | ||
this.sve.exec(input, path); | ||
} | ||
|
||
@Override | ||
public boolean exists(Path path) { | ||
throw new IllegalStateException("Should never happen"); | ||
} | ||
|
||
@Override | ||
public Bytes load(Path path) throws IOException { | ||
throw new IllegalStateException("Should never happen"); | ||
} | ||
|
||
@Override | ||
public Path absolute(Path path) { | ||
throw new IllegalStateException("Should never happen"); | ||
} | ||
|
||
@Override | ||
public Path onlyRelative(Path path) { | ||
throw new IllegalStateException("Should never happen"); | ||
} | ||
} |
Oops, something went wrong.