Android Open Source - innovativeproject-meetingdataexchange File Maintenance






From Project

Back to project page innovativeproject-meetingdataexchange.

License

The source code is released under:

MIT License

If you think the Android project innovativeproject-meetingdataexchange listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package fileMaintenance;
// w ww.jav  a2 s  .  c o m
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.TrololoCompany.meetingdataexchangedataBase.FileEntity;
import com.TrololoCompany.meetingdataexchangedataBase.MeetingEntity;
import com.TrololoCompany.meetingdataexchangedataBase.ServerEntity;

import android.content.Context;
import android.os.Environment;
import android.util.Log;

public class FileMaintenance 
{
  private static String rootPath;
  public static File root;
  public void makeRootFile(Context contex)
  {
    File storageDir=Environment.getExternalStorageDirectory();
    rootPath=storageDir.getAbsolutePath();
    rootPath=rootPath+"/meeting_data_exchange";
    Log.i("fileMaintenance",rootPath);
    root=new File(rootPath);
    if(!root.exists())
    {
      root.mkdir();
    }

  }
  public File makeServerFile(ServerEntity entity)
  {
    File server=new File(rootPath+"/"+entity.getServerName());
    if(!server.exists())
    {
      Log.i("file_maintenance","server path "+server.getAbsolutePath());
      server.mkdir();
      Log.i("file_maintenance","server file created");
      return server;
    }
    else
    {
      Log.i("file_maintenance","server name collision");
      return null;
    }
  }
  public File makeMeetingFile(ServerEntity server,MeetingEntity meeting)
  {
    File serverFile= new File(rootPath+"/"+server.getServerName());
    if(serverFile.exists())
    {
      File meetingFile= new File
          (rootPath+"/"+server.getServerName()+"/"+meeting.getTitle());
      meetingFile.mkdir();
      Log.i("file_maintenance","meeting file created");
      return meetingFile;
    }
    else
    {
      Log.i("file_maintenance","meeting file failed");
      return null;
    }
    
  }
  public File getServer(ServerEntity entity)
  {
    File serverFile= new File(rootPath+"/"+entity.getServerName());
    if(serverFile.exists())
    {
      return serverFile;
    }
    else
    {
      return null;
    }
  }
  public File getMeeting(ServerEntity server,MeetingEntity meeting)
  {
    File meetingFile= new File
        (rootPath+"/"+server.getServerName()+"/"+meeting.getTitle());
    if(meetingFile.exists())
    {
      return meetingFile;
    }
    else
    {
      return null;
    }
  }
  public File makeFileForPhoto(ServerEntity server,MeetingEntity meeting)
  {
    // Create an image file name
      String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date());
      String imageFileName = "JPEG_" + timeStamp;
      File image = null;
      File meeting_file= new File(rootPath+"/"+server.getServerName()+"/"+meeting.getTitle());
      if(!meeting_file.exists())
      {
        Log.i("file_maintenance","shit happens");
        return null;
      }
      else
      {
        try {
            image = File.createTempFile(
                imageFileName,  /* prefix */
                ".jpg",         /* suffix */
                meeting_file      /* directory */
            );
      } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      }
     return image;
  
   
    
    
  }
}




Java Source Code List

Dialogs.ServerOptionsLoggedIn.java
Dialogs.ServerOptionsLoggedOut.java
asynctasks.HttpGetListMeetings.java
asynctasks.HttpGetPersonalData.java
asynctasks.HttpGetServerName.java
asynctasks.HttpPostNewMeeting.java
asynctasks.HttpPostRequestLogInAlreadyExistsUser.java
asynctasks.HttpPostRequestLogInFirstTime.java
asynctasks.HttpPostRequestLogIn.java
asynctasks.HttpPostSignUp.java
asynctasks.HttpPutSendFile.java
asynctasks.RefreshMeetingProgress.java
com.TrololoCompany.meetingdataexchangeAdapters.FileAdapter.java
com.TrololoCompany.meetingdataexchangeAdapters.MeetingAdapter.java
com.TrololoCompany.meetingdataexchangeAdapters.ServerAdapter.java
com.TrololoCompany.meetingdataexchange.AddNewMeetingActivity.java
com.TrololoCompany.meetingdataexchange.AddServerActivityFail.java
com.TrololoCompany.meetingdataexchange.AddServerActivitySuccess.java
com.TrololoCompany.meetingdataexchange.AddServerActivity.java
com.TrololoCompany.meetingdataexchange.DisplayQR.java
com.TrololoCompany.meetingdataexchange.LogInActivity.java
com.TrololoCompany.meetingdataexchange.MainActivity.java
com.TrololoCompany.meetingdataexchange.MeetingDetails.java
com.TrololoCompany.meetingdataexchange.ServerList.java
com.TrololoCompany.meetingdataexchange.ServerManageActivity.java
com.TrololoCompany.meetingdataexchangeServices.MeetingDetailsRefresh.java
com.TrololoCompany.meetingdataexchangeServices.MeetingServerCommunication.java
com.TrololoCompany.meetingdataexchangeServices.ServiceHandlers.java
com.TrololoCompany.meetingdataexchange.SignUpActivity.java
com.TrololoCompany.meetingdataexchange.util.SystemUiHiderBase.java
com.TrololoCompany.meetingdataexchange.util.SystemUiHiderHoneycomb.java
com.TrololoCompany.meetingdataexchange.util.SystemUiHider.java
com.TrololoCompany.meetingdataexchangedataBase.CommentEntity.java
com.TrololoCompany.meetingdataexchangedataBase.DataBaseHelper.java
com.TrololoCompany.meetingdataexchangedataBase.FileEntity.java
com.TrololoCompany.meetingdataexchangedataBase.MeetingEntity.java
com.TrololoCompany.meetingdataexchangedataBase.ServerEntity.java
controllers.Accounts.java
controllers.FilesManagement.java
controllers.GeneralStuff.java
controllers.Mailing.java
controllers.Meetings.java
dataBase.CommentEntity.java
dataBase.DataBaseHelper.java
dataBase.FileEntity.java
dataBase.MeetingEntity.java
dataBase.MettingEntity.java
dataBase.ServerEntity.java
dataBase.Server.java
fileMaintenance.FileMaintenance.java
lists.MeetingList.java
lists.ServerList.java
meeting_options.FireMissilesDialogFragment.java
meeting_options.MeetDetOnPageListener.java
meeting_options.MeetDetTabListener.java
meeting_options.MeetingAddItems.java
meeting_options.MeetingDescription.java
meeting_options.MeetingProgressUIRefresh.java
meeting_options.MeetingProgress.java
meeting_options.MeetingTabPagerAdapter.java
meeting_options.MyOnPageChangeListener.java
meeting_options.MyTabListener.java
meeting_options.RefreshMeetingProgressListView.java
meeting_options.TabsPagerAdapter.java
models.DbSingleton.java
models.DefaultSchema.java
models.Keys.java
models.Tables.java
models.tables.Comment.java
models.tables.File.java
models.tables.Meeting.java
models.tables.Meetinguser.java
models.tables.Session.java
models.tables.SqliteSequence.java
models.tables.User.java
models.tables.records.CommentRecord.java
models.tables.records.FileRecord.java
models.tables.records.MeetingRecord.java
models.tables.records.MeetinguserRecord.java
models.tables.records.SessionRecord.java
models.tables.records.SqliteSequenceRecord.java
models.tables.records.UserRecord.java
serverCommunicator.CheckIsServerExists.java
serverCommunicator.CommentsHelper.java
serverCommunicator.CommunicationHelper.java
serverCommunicator.Communication.java
serverCommunicator.FileHelper.java
serverCommunicator.FileListRefreshService.java
serverCommunicator.GetMeetingListHelper.java
serverCommunicator.GetPersonalDataHelper.java
serverCommunicator.HttpGetRequest.java
serverCommunicator.HttpPostRequest.java
serverCommunicator.LogInHelper.java
serverCommunicator.MeetingHelper.java
serverCommunicator.NewMeetingHelper.java
serverCommunicator.RegistrationHelper.java
tools.MD5Checksum.java