Examples of Directory


Examples of com.linkedin.d2.balancer.Directory

      ZKFSLoadBalancer balancer = getBalancer();
      FutureCallback<None> callback = new FutureCallback<None>();
      balancer.start(callback);
      callback.get(30, TimeUnit.SECONDS);

      Directory dir = balancer.getDirectory();

      ZKConnection conn = new ZKConnection("localhost:" + PORT, 30000);
      conn.start();

      ZooKeeperPermanentStore<ServiceProperties> store =
              new ZooKeeperPermanentStore<ServiceProperties>(conn, new ServicePropertiesJsonSerializer(), ZKFSUtil.servicePath(BASE_PATH));
      callback = new FutureCallback<None>();
      store.start(callback);
      callback.get(30, TimeUnit.SECONDS);

      ServiceProperties props = new ServiceProperties(TEST_SERVICE_NAME, "someCluster", "/somePath", "someStrategy");
      store.put(TEST_SERVICE_NAME, props);

      FutureCallback<List<String>> serviceCallback = new FutureCallback<List<String>>();
      dir.getServiceNames(serviceCallback);

      Assert.assertEquals(serviceCallback.get(30, TimeUnit.SECONDS), Collections.singletonList(TEST_SERVICE_NAME));
    }
    finally
    {
View Full Code Here

Examples of com.stormpath.sdk.directory.Directory

            account.setSurname(user.getLastName());
            account.setPassword(user.getPassword());
            account.setUsername(userName);

            // Saving the account to the Directory where the Tooter application belongs.
            Directory directory = stormpath.getDirectory();
            directory.createAccount(account);

            if (user.getGroupUrl() != null && !user.getGroupUrl().isEmpty()) {
                account.addGroup(stormpath.getDataStore().getResource(user.getGroupUrl(), Group.class));
            }
View Full Code Here

Examples of cu.ftpd.filesystem.metadata.Directory

     */

    private int calculateNukeSize(File nukedDir, HashMap<String, Long> victims) {
        int totalBytesNuked = 0;
        Directory dir = ServiceManager.getServices().getMetadataHandler().getDirectory(nukedDir);
        Metadata metadata;
        Long bytesForUser;
        for (File file : nukedDir.listFiles(new ForbiddenFilesFilter())) {
            if (file.isDirectory()) {
                totalBytesNuked += calculateNukeSize(file, victims);
            } else {
                totalBytesNuked += file.length();
                metadata = dir.getMetadata(file.getName());
                if (metadata != null) { // if there's no user information for this file, then we don't do anything about it
                    bytesForUser = victims.get(metadata.getUsername());
                    if (bytesForUser == null) {
                        bytesForUser = 0L;
                    }
View Full Code Here

Examples of eu.lsem.bakalarka.model.Directory

        final int result = thesesDao.updateParentDirectory(thesisId, directoryId);
        return (result==0 ? new CustomErrorResolution(400) : new TextResolution("OK"));
    }

    public Resolution deleteDirectory() {
        Directory dirToDelete = directoriesDao.getDirectory(directoryId);
        Integer deleted = directoriesDao.deleteDirectoriesAndMoveTheses(directoryId);
        if (deleted == 1) {
            getContext().getMessages().add(new SimpleMessage("Adres�� \"{0}\" byl smaz�n", dirToDelete.getName()));
        }
        return new RedirectResolution(BrowseThesesActionBean.class).addParameter("directoryId", dirToDelete.getParentId());
    }
View Full Code Here

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

  public void initialize(String directoryProviderName, Properties properties, BuildContext context) {
    this.indexName = directoryProviderName;

    DirectoryDAO directoryDAO = new DirectoryDAO();
    Directory dir = directoryDAO.findByName(this.indexName);
    if (dir == null) {
      dir = directoryDAO.create(indexName);
    }

    this.directory = new GaeDirectory(dir);
View Full Code Here

Examples of net.datacrow.util.Directory

   
    public boolean hasReports(int module) {
        String folder = folders.get(module);
        if (folder != null) {
            String[] extensions = {"xsl", "xslt"};
            Directory dir = new Directory(folder, true, extensions);
            Collection<String> files = dir.read();
            if (files.size() > 0) return true;
        }
        return false;
    }
View Full Code Here

Examples of net.datacrow.util.Directory

        String folder = folders.get(module);
       
        Collection<ReportTemplate> reports = new ArrayList<ReportTemplate>();
        if (folder != null) {
            String[] extensions = {"xsl", "xslt"};
            Directory directory = new Directory(folder, true, extensions);
            Collection<String> files = directory.read();
            for (String filename : files) {
                ReportTemplate rf = new ReportTemplate(filename);
                if (rf.supports(transformer))
                    reports.add(rf);
            }
View Full Code Here

Examples of net.datacrow.util.Directory

        super(Thread.currentThread().getContextClassLoader());
        init(path);
    }

    private void init(String path) {
        Directory dir = new Directory(DataCrow.servicesDir, true, new String[] {"jar"});
        for (String filename :  dir.read())
            jarFiles.add(new File(filename));
    }
View Full Code Here

Examples of net.datacrow.util.Directory

    private void loadPlugins() {
        String check = File.separator + "plugins" + File.separator;
        Object[] params = new Object[] {null, null, -1, -1};
        PluginClassLoader cl = new PluginClassLoader(DataCrow.pluginsDir);
       
        Directory dir = new Directory(DataCrow.pluginsDir, true, new String[] {"class"});
        for (String filename : dir.read()) {
            try {
                String classname = filename.substring(filename.indexOf(check) + 1, filename.lastIndexOf('.'));
                classname = pattern.matcher(classname).replaceAll(".");
                Class<?> clazz = cl.loadClass(classname);
                Plugin plugin = (Plugin) clazz.getConstructors()[0].newInstance(params);
View Full Code Here

Examples of net.datacrow.util.Directory

            File fl = new File(dataDir, file);
            if (!fl.isDirectory() && !file.endsWith(".log") && !file.equals("images"))
                files.add(fl.toString());
        }

        Directory dir = new Directory(DataCrow.resourcesDir, true, null);
        Collection<String> resources = dir.read();
        for (String resource : resources) {
            if (resource.toLowerCase().endsWith(DcLanguageResource.suffix))
                files.add(resource);
        }
       
        Directory directory = new Directory(DataCrow.moduleDir, true, null);
        files.addAll(directory.read());
        directory = new Directory(DataCrow.imageDir, true, new String[] {"jpg", "jpeg"});
        files.addAll(directory.read());       

        for (String reportDir : new ReportTemplates(true).getFolders()) {
            directory = new Directory(reportDir, true, new String[] {"xsl", "xslt"});
            files.addAll(directory.read());
        }
       
        return files;
    }
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.