Fixed merge conflict.

This commit is contained in:
Winston Li 2014-12-04 19:53:19 +00:00
parent ee6273ff8c
commit d070baabde
2 changed files with 8 additions and 4 deletions

View file

@ -1,6 +1,7 @@
package uk.ac.ic.wlgitbridge.writelatex.model.db.sql;
import uk.ac.ic.wlgitbridge.writelatex.filestore.node.FileNode;
import uk.ac.ic.wlgitbridge.writelatex.filestore.store.FileIndexStore;
import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query.GetFileNodesForProjectNameSQLQuery;
import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query.GetProjectNamesSQLQuery;
import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.query.GetURLIndexTableForProjectNameSQLQuery;
@ -63,8 +64,8 @@ public class SQLiteWLDatabase {
return query(new GetVersionIDsForProjectNameSQLQuery(projectName));
}
public List<FileNode> getFileNodesForProjectName(String projectName) throws SQLException {
return query(new GetFileNodesForProjectNameSQLQuery(projectName));
public List<FileNode> getFileNodesForProjectName(String projectName, FileIndexStore fileIndexStore) throws SQLException {
return query(new GetFileNodesForProjectNameSQLQuery(projectName, fileIndexStore));
}
public Map<String, FileNode> getURLIndexTableForProjectName(String projectName) throws SQLException {

View file

@ -4,6 +4,7 @@ import uk.ac.ic.wlgitbridge.util.Util;
import uk.ac.ic.wlgitbridge.writelatex.filestore.node.AttachmentNode;
import uk.ac.ic.wlgitbridge.writelatex.filestore.node.BlobNode;
import uk.ac.ic.wlgitbridge.writelatex.filestore.node.FileNode;
import uk.ac.ic.wlgitbridge.writelatex.filestore.store.FileIndexStore;
import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLQuery;
import java.sql.PreparedStatement;
@ -21,9 +22,11 @@ public class GetFileNodesForProjectNameSQLQuery implements SQLQuery<List<FileNod
"SELECT `file_name`, `changed`, `is_blob`, `blob`, `url` FROM `file_node_table` WHERE `project_name` = ?";
private final String projectName;
private final FileIndexStore fileIndexStore;
public GetFileNodesForProjectNameSQLQuery(String projectName) {
public GetFileNodesForProjectNameSQLQuery(String projectName, FileIndexStore fileIndexStore) {
this.projectName = projectName;
this.fileIndexStore = fileIndexStore;
}
@Override
@ -37,7 +40,7 @@ public class GetFileNodesForProjectNameSQLQuery implements SQLQuery<List<FileNod
if (isBlob) {
fileNode = new BlobNode(fileName, changed, resultSet.getBytes("blob"));
} else {
fileNode = new AttachmentNode(fileName, changed, resultSet.getString("url"));
fileNode = new AttachmentNode(fileName, changed, resultSet.getString("url"), fileIndexStore);
}
fileNodes.add(fileNode);
}