parent
4cd5d5fc23
commit
c71830fd87
@ -0,0 +1,13 @@ |
|||||||
|
<component name="libraryTable"> |
||||||
|
<library name="Maven: com.google.code.gson:gson:2.8.6"> |
||||||
|
<CLASSES> |
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar!/" /> |
||||||
|
</CLASSES> |
||||||
|
<JAVADOC> |
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.6/gson-2.8.6-javadoc.jar!/" /> |
||||||
|
</JAVADOC> |
||||||
|
<SOURCES> |
||||||
|
<root url="jar://$MAVEN_REPOSITORY$/com/google/code/gson/gson/2.8.6/gson-2.8.6-sources.jar!/" /> |
||||||
|
</SOURCES> |
||||||
|
</library> |
||||||
|
</component> |
@ -0,0 +1,17 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
||||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
||||||
|
<output url="file://$MODULE_DIR$/target/classes" /> |
||||||
|
<output-test url="file://$MODULE_DIR$/target/test-classes" /> |
||||||
|
<content url="file://$MODULE_DIR$"> |
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> |
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" /> |
||||||
|
</content> |
||||||
|
<orderEntry type="inheritedJdk" /> |
||||||
|
<orderEntry type="sourceFolder" forTests="false" /> |
||||||
|
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.6" level="project" /> |
||||||
|
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.22" level="project" /> |
||||||
|
</component> |
||||||
|
</module> |
@ -0,0 +1,44 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" |
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||||
|
<modelVersion>4.0.0</modelVersion> |
||||||
|
|
||||||
|
<groupId>me.lensfrex</groupId> |
||||||
|
<artifactId>DoubanDataPraserS</artifactId> |
||||||
|
<version>1.0-SNAPSHOT</version> |
||||||
|
|
||||||
|
<properties> |
||||||
|
<maven.compiler.source>8</maven.compiler.source> |
||||||
|
<maven.compiler.target>8</maven.compiler.target> |
||||||
|
</properties> |
||||||
|
|
||||||
|
<dependencies> |
||||||
|
<dependency> |
||||||
|
<groupId>com.google.code.gson</groupId> |
||||||
|
<artifactId>gson</artifactId> |
||||||
|
<version>2.8.6</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>com.google.code.gson</groupId> |
||||||
|
<artifactId>gson</artifactId> |
||||||
|
<version>2.8.6</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<dependency> |
||||||
|
<groupId>org.projectlombok</groupId> |
||||||
|
<artifactId>lombok</artifactId> |
||||||
|
<version>1.18.22</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> |
||||||
|
<dependency> |
||||||
|
<groupId>org.apache.poi</groupId> |
||||||
|
<artifactId>poi</artifactId> |
||||||
|
<version>5.2.2</version> |
||||||
|
</dependency> |
||||||
|
|
||||||
|
</dependencies> |
||||||
|
|
||||||
|
</project> |
@ -0,0 +1,7 @@ |
|||||||
|
package me.lensfrex.doubandps; |
||||||
|
|
||||||
|
public class Main { |
||||||
|
public static void main(String[] args) { |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,20 @@ |
|||||||
|
package me.lensfrex.doubandps; |
||||||
|
|
||||||
|
import com.google.gson.annotations.SerializedName; |
||||||
|
import lombok.Data; |
||||||
|
|
||||||
|
@Data |
||||||
|
public class MovieInformation { |
||||||
|
@SerializedName("name_Ch") |
||||||
|
private String chineseName; |
||||||
|
|
||||||
|
@SerializedName("name_Fr") |
||||||
|
private String frenchName; |
||||||
|
|
||||||
|
@SerializedName("num") |
||||||
|
private int id; |
||||||
|
|
||||||
|
private float point; |
||||||
|
|
||||||
|
private int year; |
||||||
|
} |
@ -0,0 +1,49 @@ |
|||||||
|
package me.lensfrex.doubandps.utils; |
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream; |
||||||
|
import java.io.File; |
||||||
|
import java.io.FileOutputStream; |
||||||
|
import java.io.InputStream; |
||||||
|
import java.nio.charset.Charset; |
||||||
|
|
||||||
|
public class IOUtil { |
||||||
|
public static String inputStreamToString(InputStream inputStream, Charset charSet) { |
||||||
|
byte[] bytes = readDataFromInputStream(inputStream); |
||||||
|
if (bytes != null) { |
||||||
|
return new String(bytes, charSet); |
||||||
|
} else { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static byte[] readDataFromInputStream(InputStream inputStream) { |
||||||
|
return readDataFromInputStream(inputStream, 5);// read every 5kb in default
|
||||||
|
} |
||||||
|
|
||||||
|
public static byte[] readDataFromInputStream(InputStream inputStream, int byteAllocation) { |
||||||
|
try { |
||||||
|
ByteArrayOutputStream byteArrayInputStream = new ByteArrayOutputStream(); |
||||||
|
byte[] bytes = new byte[1024 * byteAllocation]; |
||||||
|
|
||||||
|
for (int length; (length = inputStream.read(bytes)) != -1; ) { |
||||||
|
byteArrayInputStream.write(bytes, 0, length); |
||||||
|
} |
||||||
|
|
||||||
|
byteArrayInputStream.flush(); |
||||||
|
|
||||||
|
inputStream.close(); |
||||||
|
byteArrayInputStream.close(); |
||||||
|
|
||||||
|
return byteArrayInputStream.toByteArray(); |
||||||
|
} catch (Exception e) { |
||||||
|
e.printStackTrace(); |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
public static void writeFile(byte[] bytes, File file) throws Exception { |
||||||
|
FileOutputStream fileOutputStream = new FileOutputStream(file); |
||||||
|
fileOutputStream.write(bytes); |
||||||
|
fileOutputStream.close(); |
||||||
|
} |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue