use of org.eclipse.ceylon.cmr.spi.ContentStore in project ceylon by eclipse.
the class DefaultNode method getContent.
@Override
@SuppressWarnings("unchecked")
public <T> T getContent(Class<T> contentType) throws IOException {
if (File.class.equals(contentType)) {
synchronized (this) {
if (handle != null)
return (T) handle.getContentAsFile();
}
final ContentStore cs = findService(ContentStore.class);
ContentHandle ch = cs.getContent(this);
if (ch == null) {
ch = HANDLE_MARKER;
}
synchronized (this) {
handle = ch;
}
return (T) ch.getContentAsFile();
} else {
return super.getContent(contentType);
}
}
use of org.eclipse.ceylon.cmr.spi.ContentStore in project ceylon by eclipse.
the class DefaultNode method getSize.
@Override
public long getSize() throws IOException {
synchronized (this) {
if (handle != null)
return handle.getSize();
}
final ContentStore cs = findService(ContentStore.class);
ContentHandle ch = cs.getContent(this);
if (ch == null) {
ch = HANDLE_MARKER;
}
synchronized (this) {
handle = ch;
}
return ch.getSize();
}
Aggregations