fileSystem added
This commit is contained in:
parent
575a64b4f6
commit
56e6a9a7d4
@ -12,6 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.util.Scanner;
|
||||||
|
|
||||||
@SpringBootTest
|
@SpringBootTest
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@ -63,13 +64,9 @@ public class FileSystemTest {
|
|||||||
|
|
||||||
|
|
||||||
InputStream inputStream = fileSystem.getFile(id1);
|
InputStream inputStream = fileSystem.getFile(id1);
|
||||||
byte[] bytes = new byte[200];
|
Scanner scanner = new Scanner(inputStream, "UTF-8");
|
||||||
try {
|
String text = scanner.useDelimiter("\\A").next();
|
||||||
inputStream.read(bytes);
|
System.out.println(text);
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
System.out.println(bytes.toString());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user