public VDBResources(VirtualFile root, VDBMetaData vdb) throws IOException { LinkedHashMap<String, VDBResources.Resource> visibilityMap = new LinkedHashMap<String, VDBResources.Resource>(); for(VirtualFile f: root.getChildrenRecursively()) { if (f.isFile()) { // remove the leading vdb name from the entry String path = f.getPathName().substring(root.getPathName().length()); if (!path.startsWith("/")) { //$NON-NLS-1$ path = "/" + path; //$NON-NLS-1$ } visibilityMap.put(path, new VDBResources.Resource(f)); } } this.vdbEntries = visibilityMap; }
VDBMetaData vdb = null; if (r != null) { vdb = VDBMetadataParser.unmarshell(r.openStream());
resources.put("/x.xsd", new VDBResources.Resource(VFS.getRootVirtualFile()));
/** * @see org.teiid.query.metadata.BasicQueryMetadata#getBinaryVDBResource(java.lang.String) * @since 4.3 */ public byte[] getBinaryVDBResource(String resourcePath) throws TeiidComponentException, QueryMetadataException { final VDBResources.Resource f = getFile(resourcePath); if (f == null) { return null; } try { return ObjectConverterUtil.convertToByteArray(f.openStream()); } catch (IOException e) { throw new TeiidComponentException(QueryPlugin.Event.TEIID30365, e); } }
/** * @see org.teiid.query.metadata.BasicQueryMetadata#getBinaryVDBResource(java.lang.String) * @since 4.3 */ public byte[] getBinaryVDBResource(String resourcePath) throws TeiidComponentException, QueryMetadataException { final VDBResources.Resource f = getFile(resourcePath); if (f == null) { return null; } try { return ObjectConverterUtil.convertToByteArray(f.openStream()); } catch (IOException e) { throw new TeiidComponentException(QueryPlugin.Event.TEIID30365, e); } }
/** * @see org.teiid.query.metadata.BasicQueryMetadata#getBinaryVDBResource(java.lang.String) * @since 4.3 */ public byte[] getBinaryVDBResource(String resourcePath) throws TeiidComponentException, QueryMetadataException { final VDBResources.Resource f = getFile(resourcePath); if (f == null) { return null; } try { return ObjectConverterUtil.convertToByteArray(f.openStream()); } catch (IOException e) { throw new TeiidComponentException(QueryPlugin.Event.TEIID30365, e); } }
public VDBResources(VirtualFile root, VDBMetaData vdb) throws IOException { LinkedHashMap<String, VDBResources.Resource> visibilityMap = new LinkedHashMap<String, VDBResources.Resource>(); for(VirtualFile f: root.getChildrenRecursively()) { if (f.isFile()) { // remove the leading vdb name from the entry String path = f.getPathName().substring(root.getPathName().length()); if (!path.startsWith("/")) { //$NON-NLS-1$ path = "/" + path; //$NON-NLS-1$ } visibilityMap.put(path, new VDBResources.Resource(f)); } } this.vdbEntries = visibilityMap; }
@Override public long getLength() { return r.getSize(); }
@Override public long getLength() { return r.getSize(); }
@Override public InputStream getInputStream() throws IOException { return r.openStream(); }
public VDBResources(VirtualFile root, VDBMetaData vdb) throws IOException { LinkedHashMap<String, VDBResources.Resource> visibilityMap = new LinkedHashMap<String, VDBResources.Resource>(); for(VirtualFile f: root.getChildrenRecursively()) { if (f.isFile()) { // remove the leading vdb name from the entry String path = f.getPathName().substring(root.getPathName().length()); if (!path.startsWith("/")) { //$NON-NLS-1$ path = "/" + path; //$NON-NLS-1$ } visibilityMap.put(path, new VDBResources.Resource(f)); } } this.vdbEntries = visibilityMap; }
@Override public long getLength() { return r.getSize(); }
@Override public InputStream getInputStream() throws IOException { return r.openStream(); }
@Before public void setUp() { MetadataStore metadataStore = new MetadataStore(); CompositeMetadataStore store = new CompositeMetadataStore(metadataStore); VDBMetaData vdbMetaData = new VDBMetaData(); vdbMetaData.setName("foo"); //$NON-NLS-1$ vdbMetaData.setVersion(1); Map<String, VDBResources.Resource> vdbEntries = new LinkedHashMap<String, VDBResources.Resource>(); vdbEntries.put(MY_RESOURCE_PATH, new VDBResources.Resource(root.getChild("foo"))); metadataFactory = new RuntimeMetadataImpl(new TransformationMetadata(vdbMetaData, store, vdbEntries, null, null)); }
@Override public InputStream getInputStream() throws IOException { return r.openStream(); }