|
|
@@ -8,10 +8,12 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.var; |
|
|
|
import org.springframework.core.io.Resource; |
|
|
|
import org.springframework.core.io.support.PathMatchingResourcePatternResolver; |
|
|
|
import org.springframework.util.StreamUtils; |
|
|
|
import sun.misc.IOUtils; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.io.InputStream; |
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
@@ -30,7 +32,8 @@ public class LanguageDetect { |
|
|
|
Resource[] resources = resolver.getResources("classpath:profiles/*"); |
|
|
|
for (Resource resource:resources) { |
|
|
|
InputStream inputStream = resource.getInputStream(); |
|
|
|
String str = new String(ByteStreams.toByteArray(inputStream)); |
|
|
|
String str = StreamUtils.copyToString(inputStream, StandardCharsets.UTF_8); |
|
|
|
// String str = new String(ByteStreams.toByteArray(inputStream)); |
|
|
|
profile.add(str); |
|
|
|
} |
|
|
|
} catch (IOException e) { |
|
|
|