本文整理汇总了Java中net.fusejna.ErrorCodes.ENODEV属性的典型用法代码示例。如果您正苦于以下问题:Java ErrorCodes.ENODEV属性的具体用法?Java ErrorCodes.ENODEV怎么用?Java ErrorCodes.ENODEV使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.fusejna.ErrorCodes
的用法示例。
在下文中一共展示了ErrorCodes.ENODEV属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: symunlink
@Override
public int symunlink(String name) {
Node node = getChild(name);
if (node == null) {
return -ErrorCodes.ENODEV();
}
Node sourceNode = this.find(name);
if (sourceNode instanceof PolicyNode) {
int r = iotClient.detachPolicy(certificateArn, sourceNode.getName());
if (r != 0) {
return r;
}
} else {
return -ErrorCodes.ENODEV();
}
return 0;
}
示例2: symunlink
@Override
public int symunlink(String name) {
Node node = getChild(name);
if (node == null) {
return -ErrorCodes.ENODEV();
}
Node sourceNode = this.find(name);
if (sourceNode instanceof CertificateNode) {
CertificateNode certificateNode = (CertificateNode) sourceNode;
int r = iotClient.detachCertificate(certificateNode.getCertificateArn(), thingName);
if (r != 0) {
return r;
}
} else {
return -ErrorCodes.ENODEV();
}
return 0;
}
示例3: translateException
private int translateException(Exception e) {
if (e instanceof ResourceNotFoundException) {
return -ErrorCodes.ENODEV();
} else if (e instanceof UnauthorizedException) {
return -ErrorCodes.EACCES();
} else if (e instanceof InvalidRequestException) {
return -ErrorCodes.EINVAL();
} else if (e instanceof DeleteConflictException) {
return -ErrorCodes.EBUSY();
}
return -ErrorCodes.EIO();
}
示例4: symlink
@Override
public int symlink(String name, String path) {
Node sourceNode = this.find(path);
if (sourceNode instanceof PolicyNode) {
int r = iotClient.attachPolicy(certificateArn, sourceNode.getName());
if (r != 0) {
return r;
}
} else {
return -ErrorCodes.ENODEV();
}
return link(name, sourceNode);
}
示例5: symlink
@Override
public int symlink(String name, String path) {
Node sourceNode = this.find(path);
if (sourceNode instanceof CertificateNode) {
CertificateNode certificateNode = (CertificateNode) sourceNode;
int r = iotClient.attachCertificate(certificateNode.getCertificateArn(), thingName);
if (r != 0) {
return r;
}
} else {
return -ErrorCodes.ENODEV();
}
return link(name, sourceNode);
}
示例6: symlink
@Override
public int symlink(String name, String path) {
Node sourceNode = this.find(path);
if (sourceNode instanceof PolicyDocumentNode && name.equals(DEFAULT_NODE_NAME)
&& sourceNode.getParent() == this) {
int r = iotClient.setDefaultPolicyVersion(parent.getName(), sourceNode.getName());
if (r != 0) {
return r;
}
} else {
return -ErrorCodes.ENODEV();
}
return link(name, sourceNode);
}