- fixed bug in BdaEntryTime.getTimestampValue

pull/4/head
Michael Zillgith 7 years ago
parent ead6f7611c
commit febe96dc73

@ -10,6 +10,7 @@ import java.io.OutputStream;
import java.io.Serializable;
import org.openmuc.jasn1.ber.*;
import org.openmuc.jasn1.ber.types.*;
import org.openmuc.jasn1.ber.types.string.BerVisibleString;
public class AlternateAccessSelection implements Serializable {

@ -9,6 +9,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import org.openmuc.jasn1.ber.*;
import org.openmuc.jasn1.ber.types.*;
public class ConfirmedRequestPDU implements Serializable {

@ -9,6 +9,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import org.openmuc.jasn1.ber.*;
import org.openmuc.jasn1.ber.types.BerInteger;
public class ConfirmedResponsePDU implements Serializable {

@ -13,6 +13,7 @@ import java.util.Iterator;
import java.io.Serializable;
import org.openmuc.jasn1.ber.*;
import org.openmuc.jasn1.ber.types.*;
import org.openmuc.jasn1.ber.types.string.BerVisibleString;
public class DeleteNamedVariableListRequest implements Serializable {

@ -9,6 +9,7 @@ import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import org.openmuc.jasn1.ber.*;
import org.openmuc.jasn1.ber.types.string.BerVisibleString;
public class ObjectName implements Serializable {

@ -57,8 +57,8 @@ public final class BdaEntryTime extends BasicDataAttribute {
if (value.length != 6) {
return -1;
}
return ((value[0] & 0xffl) << 24) + ((value[1] & 0xffl) << 16) + ((value[2] & 0xffl) << 8) + (value[3] & 0xffl)
+ (((value[4] & 0xffl) << 8) + (value[5] & 0xffl)) * 86400000l;
return (((value[0] & 0xffl) << 24) + ((value[1] & 0xffl) << 16) + ((value[2] & 0xffl) << 8) + (value[3] & 0xffl)
+ (((value[4] & 0xffl) << 8) + (value[5] & 0xffl)) * 86400000l) + 441763200000l;
}
public void setValue(byte[] value) {

@ -944,10 +944,13 @@ public final class ClientAssociation {
long fileSize = entry.getFileAttributes().getSizeOfFile().longValue();
Calendar lastModified;
Calendar lastModified = null;
try {
lastModified = entry.getFileAttributes().getLastModified().asCalendar();
if (entry.getFileAttributes().getLastModified() != null)
lastModified = entry.getFileAttributes().getLastModified().asCalendar();
} catch (ParseException e) {
throw new ServiceError(ServiceError.FAILED_DUE_TO_COMMUNICATIONS_CONSTRAINT,

@ -21,6 +21,11 @@ public class FileInformation {
return fileSize;
}
/**
* Get the time stamp of last modification. As it is an optional attribute the return value can be null
*
* @return the time stamp of last modification, or null if the time stamp is not present
*/
public Calendar getLastModified() {
return lastModified;
}

Loading…
Cancel
Save