Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Longer fid #22

Merged
merged 2 commits into from
Jun 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/fm/last/moji/MojiFileAttributes.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public interface MojiFileAttributes {

long getLength();

int getFid();
long getFid();

String getDomain();

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fm/last/moji/impl/MojiFileAttributesImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class MojiFileAttributesImpl implements MojiFileAttributes {
private final String storageClass;
private final int deviceCount;
private final long length;
private final int fid;
private final long fid;
private final String domain;
private final String key;

MojiFileAttributesImpl(Map<String, String> valueMap) {
length = Long.parseLong(valueMap.get("length"));
domain = valueMap.get("domain");
fid = Integer.parseInt(valueMap.get("fid"));
fid = Long.parseLong(valueMap.get("fid"));
deviceCount = Integer.parseInt(valueMap.get("devcount"));
storageClass = valueMap.get("class");
key = valueMap.get("key");
Expand All @@ -38,7 +38,7 @@ public long getLength() {
}

@Override
public int getFid() {
public long getFid() {
return fid;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public long getLength() {
}

@Override
public int getFid() {
public long getFid() {
return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fm/last/moji/tracker/Destination.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public class Destination {

private final URL path;
private final int devId;
private final int fid;
private final long fid;

public Destination(URL path, int devId, int fid) {
public Destination(URL path, int devId, long fid) {
this.path = path;
this.devId = devId;
this.fid = fid;
Expand All @@ -40,7 +40,7 @@ public int getDevId() {
return devId;
}

public int getFid() {
public long getFid() {
return fid;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private Request buildRequest() {
}

private void extractReturnValues(Response response) throws TrackerException {
int fid = Integer.parseInt(response.getValue("fid"));
long fid = Long.parseLong(response.getValue("fid"));
int pathCount = Integer.parseInt(response.getValue("dev_count"));
destinations = new ArrayList<Destination>(pathCount);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ public void responseNormal() throws TrackerException, MalformedURLException {

Destination destination1 = destinations.get(0);
assertThat(destination1.getDevId(), is(1));
assertThat(destination1.getFid(), is(5));
assertThat(destination1.getFid(), is(5L));
assertThat(destination1.getPath(), is(new URL(PATH_1)));

Destination destination2 = destinations.get(1);
assertThat(destination2.getDevId(), is(2));
assertThat(destination2.getFid(), is(5));
assertThat(destination2.getFid(), is(5L));
assertThat(destination2.getPath(), is(new URL(PATH_2)));
}

Expand Down