Examples of File


Examples of fi.foyt.hibernate.gae.search.persistence.domainmodel.File

  @Override
  public final boolean fileExists(String name) {
    ensureOpen();
    FileDAO fileDAO = new FileDAO();
    File file = fileDAO.findByDirectoryAndName(getDirectory(), name);
    return file != null;
  }
View Full Code Here

Examples of java.io.File

    mProperties = prop;
  }
 
  public DefaultSettings() {
    mProperties = new Properties();
    File settingsFile = new File(FILENAME);
    if (settingsFile.canRead() && !TVBrowser.isTransportable()) {
      StreamUtilities.inputStreamIgnoringExceptions(settingsFile,
          new InputStreamProcessor() {

            @Override
            public void process(InputStream input) throws IOException {
View Full Code Here

Examples of java.io.File

    return bean.getResource(id);
  }
 
  public static Vector getResourceXmlBeans(HttpServlet servlet) throws Exception {
    if( bean == null ) {
      FileInputStream fis = new FileInputStream( new File(servlet.getServletContext().getRealPath("../../../conf/resources.xml")) );
      bean = ResourceXmlBean.parse(fis);
      fis.close();
    }
    return bean.getItems();
  }
View Full Code Here

Examples of java.io.File

  private static TypeBean bean;
 
  public static TypeBean getSectionBean(HttpServlet servlet, String template) throws Exception {
    if( bean == null ) {
      FileInputStream fis = new FileInputStream( new File(servlet.getServletContext().getRealPath("../../../conf/templates.xml")) );
      bean = TypeBean.parse(fis);
      fis.close();
    }
    return bean.getBean(template);
  }
View Full Code Here

Examples of java.io.File

    return bean.getBean(template);
  }
 
  public static Vector getSectionsBeans(HttpServlet servlet) throws Exception {
    if( bean == null ) {
      FileInputStream fis = new FileInputStream( new File(servlet.getServletContext().getRealPath("../../../conf/templates.xml")) );
      bean = TypeBean.parse(fis);
      fis.close();
    }
    return bean.getItems();
  }
View Full Code Here

Examples of java.io.File

  public void setObjectSerializer(ObjectSerializer serializer) {
    this.serializer = serializer;
  }   
 
  private void saveMetadataStore(VFSDeploymentUnit unit, VDBMetaData vdb, MetadataStoreGroup store) throws IOException {
    File cacheFileName = buildCachedVDBFileName(this.serializer, unit, vdb);
    if (!cacheFileName.exists()) {
      this.serializer.saveAttachment(cacheFileName,store);
      LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB "+unit.getRoot().getName()+" metadata has been cached to "+ cacheFileName); //$NON-NLS-1$ //$NON-NLS-2$
    }   
  }
View Full Code Here

Examples of java.io.File

        if (model.getSourceNames().isEmpty()) {
          throw new DeploymentException(RuntimePlugin.Util.getString("fail_to_deploy", vdb.getName()+"-"+vdb.getVersion(), model.getName())); //$NON-NLS-1$ //$NON-NLS-2$
        }
           
        final boolean cache = "cached".equalsIgnoreCase(vdb.getPropertyValue("UseConnectorMetadata")); //$NON-NLS-1$ //$NON-NLS-2$
        final File cacheFile = buildCachedModelFileName(unit, vdb, model.getName());
        boolean loaded = false;
        if (cache) {
        MetadataStore store = this.serializer.loadSafe(cacheFile, MetadataStore.class);
        if (store != null) {
          vdbStore.addStore(store);
View Full Code Here

Examples of java.io.File

    if (imf != null) {
      imf.addEntriesPlusVisibilities(unit.getRoot(), vdb);
      unit.addAttachment(IndexMetadataFactory.class, imf);
             
      // add the cached store.
      File cacheFile = VDBDeployer.buildCachedVDBFileName(this.serializer, unit, vdb);
      // check to see if the vdb has been modified when server is down; if it is then clear the old files
      if (this.serializer.isStale(cacheFile, unit.getRoot().getLastModified())) {
        this.serializer.removeAttachments(unit);
        LogManager.logTrace(LogConstants.CTX_RUNTIME, "VDB", unit.getRoot().getName(), "old cached metadata has been removed"); //$NON-NLS-1$ //$NON-NLS-2$       
      }
View Full Code Here

Examples of java.io.File

    return (cacheFile.exists() && timeAfter > cacheFile.lastModified());
  }
 
  public void removeAttachments(VFSDeploymentUnit vf) {
    String dirName = baseDirectory(vf);
    FileUtils.removeDirectoryAndChildren(new File(dirName));
  }
View Full Code Here

Examples of java.io.File

  public File getAttachmentPath(VFSDeploymentUnit vf, String baseName) {
   
    String dirName = baseDirectory(vf);

    final String vfsPath = baseName + ATTACHMENT_SUFFIX;
    File f = new File(dirName, vfsPath);
    if (!f.getParentFile().exists()) {
      f.getParentFile().mkdirs();
    }
    return f;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.